]> granicus.if.org Git - clang/commitdiff
Stop asserting when a meaningless -std= flag is passed for a non-compilation
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 14 Feb 2017 23:41:38 +0000 (23:41 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 14 Feb 2017 23:41:38 +0000 (23:41 +0000)
input kind; go back to silently ignoring the flag.

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

lib/Frontend/CompilerInvocation.cpp
test/Driver/unknown-std.S [new file with mode: 0644]

index 3001a2dda46d494b5634774338f17d48658a851b..2ef96398c0d9d5d20482b75a9cfcd1d1ffd6560c 100644 (file)
@@ -1702,8 +1702,8 @@ static bool IsInputCompatibleWithStandard(InputKind IK,
       return true;
     break;
   default:
-    llvm_unreachable("Cannot decide whether language standard and "
-        "input file kind are compatible!");
+    // For other inputs, accept (and ignore) all -std= values.
+    return true;
   }
   return false;
 }
diff --git a/test/Driver/unknown-std.S b/test/Driver/unknown-std.S
new file mode 100644 (file)
index 0000000..ecb6a9e
--- /dev/null
@@ -0,0 +1,2 @@
+// RUN: %clang -std=c++11 %s -E -o /dev/null 2>&1 | FileCheck %s --allow-empty
+// CHECK-NOT: error