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/Sema | |
| 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/Sema')
| -rw-r--r-- | clang/test/Sema/thread-specifier.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/Sema/thread-specifier.c b/clang/test/Sema/thread-specifier.c index 3968ae14cf2..71e44c34726 100644 --- a/clang/test/Sema/thread-specifier.c +++ b/clang/test/Sema/thread-specifier.c @@ -5,6 +5,8 @@ // RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic -x c++ %s -DCXX11 -D__thread=thread_local -std=c++11 -Wno-deprecated // RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic -x c++ %s -DC11 -D__thread=_Thread_local -std=c++11 -Wno-deprecated +#pragma clang diagnostic ignored "-Wkeyword-macro" + #ifdef __cplusplus // In C++, we define __private_extern__ to extern. #undef __private_extern__ |

