summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp2
-rw-r--r--clang/test/Frontend/exceptions.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index fb52eb489e0..dbb59b4f9f1 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -491,7 +491,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("__BLOCKS__");
}
- if (LangOpts.CXXExceptions)
+ if (!LangOpts.MSVCCompat && LangOpts.CXXExceptions)
Builder.defineMacro("__EXCEPTIONS");
if (LangOpts.RTTI)
Builder.defineMacro("__GXX_RTTI");
diff --git a/clang/test/Frontend/exceptions.c b/clang/test/Frontend/exceptions.c
new file mode 100644
index 00000000000..4bbaaa39bfa
--- /dev/null
+++ b/clang/test/Frontend/exceptions.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -verify %s
+// expected-no-diagnostics
+
+#if defined(__EXCEPTIONS)
+#error __EXCEPTIONS should not be defined.
+#endif
OpenPOWER on IntegriCloud