]> granicus.if.org Git - clang/commitdiff
Driver: Don't honor -std-default for C++, this makes it hard to run the gdb test
authorDaniel Dunbar <daniel@zuster.org>
Fri, 29 Jan 2010 21:03:02 +0000 (21:03 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 29 Jan 2010 21:03:02 +0000 (21:03 +0000)
suite with clang++ enabled.

The right fix here is PR6175, although we would still have to find a different
work around for the gdb test suite.

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

lib/Driver/Tools.cpp

index 565c13c275d1529acccf379da8fc8a2e8619e2b2..2e7435fa32a5e581515852abe2c58e5cf0768359 100644 (file)
@@ -901,8 +901,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
         A->render(Args, CmdArgs);
   } else {
     // Honor -std-default.
-    Args.AddAllArgsTranslated(CmdArgs, options::OPT_std_default_EQ,
-                              "-std=", /*Joined=*/true);
+    //
+    // FIXME: Clang doesn't correctly handle -std= when the input language
+    // doesn't match. For the time being just ignore this for C++ inputs;
+    // eventually we want to do all the standard defaulting here instead of
+    // splitting it between the driver and clang -cc1.
+    if (!types::isCXX(InputType))
+        Args.AddAllArgsTranslated(CmdArgs, options::OPT_std_default_EQ,
+                                  "-std=", /*Joined=*/true);
     Args.AddLastArg(CmdArgs, options::OPT_trigraphs);
   }