summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/macro-reserved.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixed warnings on redefine keywords and reserved ids.Serge Pavlov2014-12-181-7/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move -Wkeyword-macro into -pedantic, remove -Wreserved-id-macro.Nico Weber2014-12-161-6/+6
| | | | | | | | | | | | | | | | | | | As discussed on the post-commit review thread for r224012, -Wkeyword-macro fires mostly on headers trying to set up portable defines and doesn't find much bad stuff in practice. But [macro.names]p2 does disallow defining or undefining keywords, override and final, and alignas, so keep the warning but move it into -pedantic. -Wreserved-id-macro warns on #define __need_size_t which is more or less public api for glibc headers. Since this warning isn't motivated by a standard, remove it. (See also r223114 for a previous follow-up to r224012.) llvm-svn: 224371
* Do not warn on keyword undefSerge Pavlov2014-12-121-0/+25
#undef a keyword is generally harmless but used often in configuration scripts. Also added tests that I forgot to include to commit in r223114. llvm-svn: 224100
OpenPOWER on IntegriCloud