public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/109994] New: Issue a diagnostic when a C++ file defines a macro that hides a keyword
@ 2023-05-26 16:31 redi at gcc dot gnu.org
  2023-05-26 16:34 ` [Bug preprocessor/109994] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2023-05-26 16:31 UTC (permalink / raw)
  To: gcc-bugs

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).

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-21 22:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26 16:31 [Bug preprocessor/109994] New: Issue a diagnostic when a C++ file defines a macro that hides a keyword redi at gcc dot gnu.org
2023-05-26 16:34 ` [Bug preprocessor/109994] " mpolacek at gcc dot gnu.org
2023-05-26 16:40 ` pinskia at gcc dot gnu.org
2023-05-26 16:41 ` redi at gcc dot gnu.org
2023-05-26 16:42 ` jakub at gcc dot gnu.org
2024-01-21 22:22 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).