diff options
| author | Alp Toker <alp@nuanti.com> | 2014-05-31 16:32:22 +0000 |
|---|---|---|
| committer | Alp Toker <alp@nuanti.com> | 2014-05-31 16:32:22 +0000 |
| commit | e03e9e15f2a66fe1b947322850e37b8133521759 (patch) | |
| tree | 8efefe8b7b8b4d2a315f0dd766b5a07529df0bbc /clang/test | |
| parent | b4690e3fd1c6b660fc4e9ef58ab8b34964a1c7a9 (diff) | |
| download | bcm5719-llvm-e03e9e15f2a66fe1b947322850e37b8133521759.tar.gz bcm5719-llvm-e03e9e15f2a66fe1b947322850e37b8133521759.zip | |
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.
llvm-svn: 209978
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Parser/MicrosoftExtensions.cpp | 3 | ||||
| -rw-r--r-- | clang/test/Preprocessor/cxx_oper_keyword_ms_compat.cpp | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp index 5f3c2a26fc0..72d6c2ed58c 100644 --- a/clang/test/Parser/MicrosoftExtensions.cpp +++ b/clang/test/Parser/MicrosoftExtensions.cpp @@ -426,3 +426,6 @@ void TestProperty() { sp.V11++; ++sp.V11; } + +//expected-warning@+1 {{C++ operator 'and' (aka '&&') used as a macro name}} +#define and foo diff --git a/clang/test/Preprocessor/cxx_oper_keyword_ms_compat.cpp b/clang/test/Preprocessor/cxx_oper_keyword_ms_compat.cpp index dcf6908c329..8e1351e3472 100644 --- a/clang/test/Preprocessor/cxx_oper_keyword_ms_compat.cpp +++ b/clang/test/Preprocessor/cxx_oper_keyword_ms_compat.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 %s -E -fms-compatibility +// RUN: %clang_cc1 %s -E -verify -fms-extensions +// expected-no-diagnostics bool f() { // Check that operators still work before redefining them. |

