]> granicus.if.org Git - clang/commitdiff
Don't enable /GX by default
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 22 Feb 2016 17:44:51 +0000 (17:44 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 22 Feb 2016 17:44:51 +0000 (17:44 +0000)
The /GX flag is disabled unless explicitly specified on the command
line.  This partially addresses PR26698.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261537 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/cl-options.c

index fd647a484e68c93038ba412a22134cd6b30b99a4..b04ef6c03090b6056be8a31da0248fb70f500fd6 100644 (file)
@@ -5813,8 +5813,10 @@ static EHFlags parseClangCLEHFlags(const Driver &D, const ArgList &Args) {
     }
   }
   // The /GX, /GX- flags are only processed if there are not /EH flags.
+  // The default is that /GX is not specified.
   if (EHArgs.empty() &&
-      Args.hasFlag(options::OPT__SLASH_GX, options::OPT__SLASH_GX_)) {
+      Args.hasFlag(options::OPT__SLASH_GX, options::OPT__SLASH_GX_,
+                   /*default=*/false)) {
     EH.Synch = true;
     EH.NoUnwindC = true;
   }
index 0f9f9a4fcc07a0544b3f51cd77ee447ccdcc1bdc..8a3cb4473e6932cde8af3ff888938e8372ced6a3 100644 (file)
 // RUN: %clang_cl /FI asdf.h -### -- %s 2>&1 | FileCheck -check-prefix=FI_ %s
 // FI_: "-include" "asdf.h"
 
+// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=NO-GX %s
+// NO-GX-NOT: "-fcxx-exceptions" "-fexceptions"
+
 // RUN: %clang_cl /c /GX -### -- %s 2>&1 | FileCheck -check-prefix=GX %s
 // GX: "-fcxx-exceptions" "-fexceptions"