[PATCH] Emit warning if define or undef reserved identifier or keyword.

Serge Pavlov sepavloff at gmail.com
Mon Nov 10 09:55:00 PST 2014


This change implements warnings if macro name is identical to a keyword or
reserved identifier. The warnings are different depending on the "danger"
of the operation. Defining macro that replaces a keyword is on by default.
Other cases produce warning that is off by default but can be turned on
using option -Wreserved-id-macro.

This change fixes PR11488.

http://reviews.llvm.org/D6194

Files:
  include/clang/Basic/DiagnosticGroups.td
  include/clang/Basic/DiagnosticLexKinds.td
  include/clang/Basic/IdentifierTable.h
  lib/Basic/IdentifierTable.cpp
  lib/Lex/PPDirectives.cpp
  test/PCH/single-token-macro.c
  test/Preprocessor/cxx_oper_keyword_ms_compat.cpp
  test/Preprocessor/macro-reserved.c
  test/Preprocessor/macro-reserved.cpp
  test/Sema/thread-specifier.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6194.15994.patch
Type: text/x-patch
Size: 10648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141110/ccffb741/attachment.bin>


More information about the cfe-commits mailing list