This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: potential preprocessor bug in latest g++?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]