This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
potential preprocessor bug in latest g++?
- To: gcc-bugs at gcc dot gnu dot org
- Subject: potential preprocessor bug in latest g++?
- From: David Howells <David dot Howells at nexor dot co dot uk>
- Date: Thu, 27 Jul 2000 11:49:54 +0100
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);