Opened 17 years ago
Closed 17 years ago
#444 closed Bugs (Fixed)
Move comments in BOOST_STATIC_CONSTANT
| Reported by: | nobody | Owned by: | david_abrahams |
|---|---|---|---|
| Milestone: | Component: | type_traits | |
| Version: | None | Severity: | |
| Keywords: | Cc: |
Description
There appears to be some comments in one of the
macro function calls of BOOST_STATIC_CONSTANT
(line 124 of "type_traits/is_enum.hpp):
BOOST_STATIC_CONSTANT(bool, selector =
(::boost::type_traits::ice_or<
::boost::is_arithmetic<T>::value
, ::boost::is_reference<T>::value
, is_class_or_union<T>::value
// However, not doing this on non-conforming
compilers prevents
// a dependency recursion.
>::value));
This is not incorrect but it expands to incorrect code in
case you run the Visual Studio.NET 2002/2003/2005
C++ compiler with the compiler options "/E /C". The
result after preprocessing is:
// However, not doing this on non-conforming compilers
prevents// a dependency recursion.enum { selector =
(::boost::type_traits::ice_or< ::boost::is_arithmetic<T>::v
alue , ::boost::is_reference<T>::value ,
is_class_or_union<T>::value >::value) };
which obviously hides the definition of "selector"! Since
we are performing code checking on the preprocessed
file our code checker is unable to check C++ files that
contain "is_enum.hpp".
This is clearly a bug in the Visual Studio C++ compiler,
but my hopes are that the comments can be moved in
Boost, e.g. towards the start of the macro function call
or the end. This will solve the problem of being able to
code check this file. It might solve problems with other
preprocessors as well.
In case you need further details, contact me at
Paul.Jansen@tiobe.com.
Regards,
Paul Jansen
Note:
See TracTickets
for help on using tickets.
