https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109994
Bug ID: 109994 Summary: Issue a diagnostic when a C++ file defines a macro that hides a keyword Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: diagnostic Severity: enhancement Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- The C++ standard says this is undefined: #define new foo It might be nice if the preprocessor had a warning about it. [macro.names] A translation unit shall not #define or #undef names lexically identical to keywords, to the identifiers listed in Table 4, or to the attribute-tokens described in 9.12, except that the names likely and unlikely may be defined as function-like macros (15.6).