
Zeljko Vrba wrote:
On Mon, Sep 22, 2008 at 12:44:01PM -0600, Robert Mecklenburg wrote:
I would swear that the standard indicated that public/private had no effect on visibility, just accessibility. That is, changing a symbol's access from private to public did not change the meaning of a program. Stroustrup uses such language in the D&E of C++.
I recall somewhat vaguely a similar discussion on comp.lang.c++.moderated where the conclusion was that redefining keywords such as public/private via preprocessor macros leads to undefined behavior. I don't think that MS violates the standard with this particular behavior.
Correct. This is worded in C++03, [lib.macro.names]/2: "[..] Nor shall such a translation unit define macros for names lexically identical to keywords." The current working paper has refined this in [macro.names]/2: "A translation unit shall not #define or #undef names lexically identical to keywords." Greetings from Bremen, Daniel