Fixed warnings on redefine keywords and reserved ids.
authorSerge Pavlov <sepavloff@gmail.com>
Thu, 18 Dec 2014 11:14:21 +0000 (11:14 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Thu, 18 Dec 2014 11:14:21 +0000 (11:14 +0000)
commit07c0f04e08c840fc8bf1bfb8d5a2775b40c6e503
treec2501b10b465ff12299b7af533ee91e930a8169e
parent794771b08bec6272a40b8f952fa6ea6d7586cf28
Fixed warnings on redefine keywords and reserved ids.

Repared support for warnings -Wkeyword-macro and -Wreserved-id-macro.
The warning -Wkeyword-macro now is not issued in patterns that are used
in configuration scripts:

    #define inline

also for 'const', 'extern' and 'static'. If macro repalcement is identical
to macro name, the warning also is not issued:

    #define volatile volatile

And finally if macro replacement is also a keyword identical to the replaced
one but decorated with leading/trailing underscores:

    #define inline __inline
    #define inline __inline__
    #define inline _inline // in MSVC compatibility mode

Warning -Wreserved-id-macro is off by default, it could help catching
things like:

    #undef __cplusplus

llvm-svn: 224512
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticLexKinds.td
clang/include/clang/Lex/Preprocessor.h
clang/lib/Lex/PPDirectives.cpp
clang/test/Preprocessor/macro-reserved-cxx11.cpp [new file with mode: 0644]
clang/test/Preprocessor/macro-reserved-ms.c [new file with mode: 0644]
clang/test/Preprocessor/macro-reserved.c
clang/test/Preprocessor/macro-reserved.cpp