In C++, the closest thing to forbidding #define
ing a keyword is §17.4.3.1.1/2, which only disallows it in a translation unit that includes a standard library header:
A translation unit that includes a header shall not contain any macros that define names declared or defined in that header. Nor shall such a translation unit define macros for names lexically identical to keywords.
The second sentence of that paragraph has been changed in C++0x to outright forbid #define
ing a keyword (C++0x FCD §17.6.3.3.1):
A translation unit shall not #define or #undef names lexically identical to keywords.
Edit: As pointed out by Ken Bloom in comments to his answer, the rules have not changed in C++0x; the text has just been rearranged to confuse people like me. :-)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…