Do not predefine __EXCEPTIONS in clang-cl (PR19977)

Patch by Ehsan Akhgari! (Test tweak by me.)

Differential Revision: http://reviews.llvm.org/D4065

llvm-svn: 210582
This commit is contained in:
Hans Wennborg 2014-06-10 20:46:38 +00:00
parent 826ba908e2
commit 35bbf1cf8a
2 changed files with 7 additions and 1 deletions

View File

@ -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");

View File

@ -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