Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #68740
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: upper case enumerator |
| Date | 2019-09-28 21:58 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <874l0wqgt6.fsf@bsb.me.uk> (permalink) |
| References | <afea241c-fdd5-485d-89b2-22c402d7e3cb@googlegroups.com> |
Mark <ma740988@gmail.com> writes:
> # define XXX_YYY
<cut>
> namespace foo
> {
> enum kFavoriteWine { kMoscato, XXX_YYY } ;
> }
<cut>
> using namespace foo ;
> kFavoriteWine xx = XXX_YYY ;
> Why does the upper case enumerator collided with the preprocessor
> macro even though the macro is wrapped in a namespace? Can someone
> point me to some standard verbiage saying why that's wrong
To expand yet again on the other answers...
The verbiage is section 2.2 Phases of Translation. It explains the
logical sequence in which source files are processed. Macros are
expanded in phase 4, whereas what we usually think of a parsing happens
in phase 7. By phase 7 there is no identifier 'XXX_YYY' -- they all
vanished in phase 4.
--
Ben.
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
upper case enumerator Mark <ma740988@gmail.com> - 2019-09-27 19:37 -0700
Re: upper case enumerator Ian Collins <ian-news@hotmail.com> - 2019-09-28 14:43 +1200
Re: upper case enumerator Louis Krupp <lkrupp@nospam.pssw.com.invalid> - 2019-09-27 23:48 -0600
Re: upper case enumerator Bo Persson <bo@bo-persson.se> - 2019-09-28 10:06 +0200
Re: upper case enumerator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-09-28 21:58 +0100
Re: upper case enumerator Öö Tiib <ootiib@hot.ee> - 2019-09-28 17:10 -0700
Re: upper case enumerator Vir Campestris <vir.campestris@invalid.invalid> - 2019-09-29 21:45 +0100
Re: upper case enumerator Manfred <noname@add.invalid> - 2019-09-29 23:29 +0200
Re: upper case enumerator Ian Collins <ian-news@hotmail.com> - 2019-09-30 16:36 +1300
Re: upper case enumerator Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-09-30 12:25 +0000
Re: upper case enumerator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-09-30 14:55 +0100
Re: upper case enumerator James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-09-30 01:11 -0400
Re: upper case enumerator Frederick Gotham <cauldwell.thomas@gmail.com> - 2019-09-30 01:34 -0700
csiph-web