potential preprocessor bug in latest g++?

Alexandre Oliva aoliva@redhat.com
Thu Jul 27 14:26:00 GMT 2000


On Jul 27, 2000, David Howells <David.Howells@nexor.co.uk> wrote:

> gccquery.cpp:16:30: warning: pasting would not give a valid preprocessing token

The warning is appropriate.  `foo::IBar' is not a valid token.  `foo',
`::' and `iBar' are three separate tokens.  Pasting them together is
wrong.

> #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);

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Gcc-bugs mailing list