]> granicus.if.org Git - clang/commit
Emit warning if define or undef reserved identifier or keyword.
authorSerge Pavlov <sepavloff@gmail.com>
Tue, 2 Dec 2014 11:06:09 +0000 (11:06 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Tue, 2 Dec 2014 11:06:09 +0000 (11:06 +0000)
commitd04e6fdd403fcd39dc96075df858cd942c3ceab5
treebfb6268d3c7431aa8d44500ae098d0ca4847e304
parent85fd1028d5358138fcfae7adb9c09a386a91c332
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
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/Sema/thread-specifier.c