potential preprocessor bug in latest g++?
David Howells
David.Howells@nexor.co.uk
Thu Jul 27 03:50:00 GMT 2000
If you try compiling the fragment of code attached to the bottom of this
message, the latest "g++ -E" compiler gives the following error messages (but
does produce the code expected):
gccquery.cpp:16:30: warning: pasting would not give a valid preprocessing token
gccquery.cpp:16:30: warning: pasting would not give a valid preprocessing token
Note that MSVC++ somewhat older versions of g++ both quite happily preprocess
this.
The compiler version:
Reading specs from /opt/gcc/bin/../lib/gcc-lib/i386-pc-linux-gnu/2.96/specs
gcc version 2.96 20000719 (experimental)
David Howells
=============
struct IID;
namespace foo {
struct IBar;
extern const IID IID_IBar;
}
template<class T> struct com_if_traits {};
#define DECLARE_COM_TRAITS(NAMESPACE,CLASS) \
struct com_if_traits<NAMESPACE ## CLASS> { \
static inline const IID& GetIID() { return NAMESPACE ## IID_##CLASS; } \
}
DECLARE_COM_TRAITS(foo::,IBar);
More information about the Gcc-bugs
mailing list