]> granicus.if.org Git - clang/commit
Merging r196212:
authorBill Wendling <isanbard@gmail.com>
Mon, 16 Dec 2013 02:32:55 +0000 (02:32 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 16 Dec 2013 02:32:55 +0000 (02:32 +0000)
commit03e463e293f5ecf62cb8c807d00edb9fbb1f99d7
treeffeaaba7a9beaab140246935694cb01b4b96cad1
parentb3617be53923ac3e5885ff5001aa748bd0223102
Merging r196212:
------------------------------------------------------------------------
r196212 | alp | 2013-12-02 22:13:01 -0800 (Mon, 02 Dec 2013) | 22 lines

Emit an extension warning when changing system header tokens

clang converts keywords to identifiers for compatibility with various system
headers such as GNU libc.

Implement a -Wkeyword-compat extension warning to diagnose those cases. The
warning is on by default but will generally be ignored in system headers. It
can however be enabled globally to aid standards conformance testing.

This also changes the __uptr keyword avoidance from r195710 to no longer
special-case system headers, bringing it in line with other similar workarounds
in clang.

Implementation returns bool for symmetry with token annotation functions.

Some examples:

warning: keyword '__is_pod' will be treated as an identifier for the remainder of the translation unit [-Wkeyword-compat]
struct __is_pod

warning: keyword '__uptr' will be treated as an identifier here [-Wkeyword-compat]
union w *__uptr;
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@197359 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Parse/Parser.h
lib/Parse/ParseDecl.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Parse/Parser.cpp
test/PCH/cxx-traits.cpp
test/PCH/cxx-traits.h
test/Sema/Inputs/ms-keyword-system-header.h
test/Sema/ms-keyword-system-header.c