This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ alternative tokens in the preprocessor
On Jul 18, 2000, Zack Weinberg <zack@wolery.cumb.org> wrote:
> Okay, here is the $64,000 question. Is this legal C++?
> #define and && !
I'm not sure it should be rejected but, even if it's accepted, it
shouldn't do what you want. `and' is a C++ preprocessing operator,
defined in [lex.operators], so I'd expect it to be parsed as such,
even in case it is #defined to something else. [lex.key]/2 says these
alternative representations of operators are reserved and shall not be
used otherwise. But then, keywords are only meaningful after
preprocessing (i.e., you can #define new and delete), so this is a bit
fuzzy.
--
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