Emit warning if define or undef reserved identifier or keyword.
Summary: 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. Reviewers: rnk Reviewed By: rnk Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D6194 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223114 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Basic/DiagnosticGroups.td 2 additions, 0 deletionsinclude/clang/Basic/DiagnosticGroups.td
- include/clang/Basic/DiagnosticLexKinds.td 8 additions, 0 deletionsinclude/clang/Basic/DiagnosticLexKinds.td
- include/clang/Basic/IdentifierTable.h 3 additions, 0 deletionsinclude/clang/Basic/IdentifierTable.h
- lib/Basic/IdentifierTable.cpp 27 additions, 2 deletionslib/Basic/IdentifierTable.cpp
- lib/Lex/PPDirectives.cpp 69 additions, 0 deletionslib/Lex/PPDirectives.cpp
- test/PCH/single-token-macro.c 2 additions, 0 deletionstest/PCH/single-token-macro.c
- test/Preprocessor/cxx_oper_keyword_ms_compat.cpp 2 additions, 0 deletionstest/Preprocessor/cxx_oper_keyword_ms_compat.cpp
- test/Sema/thread-specifier.c 2 additions, 0 deletionstest/Sema/thread-specifier.c
Loading
Please register or sign in to comment