[GCC-XML] compilation pb running gccxml on code using SFINAE

Brad King brad.king at kitware.com
Wed Jun 6 15:15:50 EDT 2007


MOSS Sebastian wrote:
>  enum { value = (...) };
[snip]
> Enumerator value for ‘value’ not integer constant.
> 
> This struct compiles fine with the vs7.1 compiler and I can see in the
> gccxml_config file in the gccxml directory the following lines:
[snip]
> My guess is that an older gcc compiler is being simulated as this error
> is produced with gcc 3.2.3 for example, but not with 3.4.2.

GCC-XML uses a GCC 3.3 parser internally no matter the compiler being
simulated.  The "simulation" is only from the point of view fo the
preprocessor.

I bet you're using BOOST_STATIC_CONST or a copy of it to define that
value.  It is implemented using "enum" on some platforms and "static
const" on others.  When GCC-XML simulates MSVC it tricks boost into
selecting the implementation that is compatible with that compiler but
the real parser is still GCC.

This is discussed in more detail in the boost mailing list thread
starting here:

  http://lists.boost.org/Archives/boost/2006/01/98989.php

This is the main point from that message:

  "GCC-XML is effectively another compiler for which knowledge should be
   encoded into the boost libraries. When __GCCXML__ is defined any
   *parser* work-around should use the GCC alternative, while any
   *interface* work-around should use the native compiler's
   alternative."

-Brad



More information about the gccxml mailing list