Commit Graph

6 Commits

Author SHA1 Message Date
Serge Pavlov b13e6793c2 Emit warning if define or undef reserved identifier or keyword.
Recommit of r223114, reverted in r223120.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224012 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 12:18:08 +00:00
Serge Pavlov a72e27bdfa Reverted r223114, it caused failure on on clang-native-arm-cortex-a9.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223120 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 14:52:20 +00:00
Serge Pavlov d04e6fdd40 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223114 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 11:06:09 +00:00
Alp Toker 5c0a1a4468 Preprocessor: make C++ operator names as macro identifiers a compatible extension
With recent changes, this is now a compatible language extension and can be
safely enabled with -ms-extensions instead of requiring the full
-ms-compatibility MSVC drop-in mode. As such we can now also emit an extension
warning under -Wmicrosoft to help users port their code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209978 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-31 16:32:22 +00:00
Alp Toker 4f6988e487 Preprocessor: support defined() with operator names for MS compatibility
Also flesh out missing tests, improve diagnostic QOI and fix a couple of corner
cases found in the process.

Fixes PR10606.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209276 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 06:13:51 +00:00
Nico Weber 07a4b0488b Move suport for redefining operator keywords from -fms-extensions to -fms-compatibility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151776 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 00:13:46 +00:00