diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2014-12-02 11:06:09 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2014-12-02 11:06:09 +0000 |
commit | 1ecb41c09b7d81b6ad0d9934ede8464a5c142b2c (patch) | |
tree | 83e7f2a8ab343d7570fbf20054402eb00643e8fa /clang/test/PCH/single-token-macro.c | |
parent | a0199b9a594151cd8889665de57ab2b3f69ee137 (diff) | |
download | bcm5719-llvm-1ecb41c09b7d81b6ad0d9934ede8464a5c142b2c.tar.gz bcm5719-llvm-1ecb41c09b7d81b6ad0d9934ede8464a5c142b2c.zip |
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
llvm-svn: 223114
Diffstat (limited to 'clang/test/PCH/single-token-macro.c')
-rw-r--r-- | clang/test/PCH/single-token-macro.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/PCH/single-token-macro.c b/clang/test/PCH/single-token-macro.c index aa02f65f78b..b077abaa036 100644 --- a/clang/test/PCH/single-token-macro.c +++ b/clang/test/PCH/single-token-macro.c @@ -12,6 +12,8 @@ #ifndef HEADER #define HEADER +#pragma clang diagnostic ignored "-Wreserved-id-macro" + #ifdef __stdcall // __stdcall is defined as __attribute__((__stdcall__)) for targeting mingw32. #undef __stdcall |