[GCC-XML] compilation pb running gccxml on code using SFINAE
MOSS Sebastian
Sebastian.MOSS at murex.com
Wed Jun 6 17:13:48 EDT 2007
Hi Brad,
Thanks for the quick reply.
Actually, I started out using some of the boost::mpl features for this,
but due to a bunch of compilation pbs I ended up foregoing it (although
at some point I'll need to use the preprocessor lib).
The code I posted was a complete example in itself - ie no use of Boost
macros. I tried the static const approach as well - as I'm using some
template specializations using has_nested_value_type<>::value - I got
the complementary error 'non-const type cannot be used as a template
param'.
So ultimately I guess this is a limitation with gcc3.3 right?
Are there any plans to port gccxml to leverage some of the newer gcc
versions?
Thanks again,
s
-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: Wednesday, June 06, 2007 3:16 PM
To: MOSS Sebastian
Cc: gccxml at gccxml.org
Subject: Re: [GCC-XML] compilation pb running gccxml on code using
SFINAE
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
*******************************
This e-mail contains information for the intended recipient only. It may contain proprietary material or confidential information. If you are not the intended recipient you are not authorised to distribute, copy or use this e-mail or any attachment to it. Murex cannot guarantee that it is virus free and accepts no responsibility for any loss or damage arising from its use. If you have received this e-mail in error please notify immediately the sender and delete the original email received, any attachments and all copies from your system.
More information about the gccxml
mailing list