summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-02-14 23:41:38 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-02-14 23:41:38 +0000
commit222b30b9d39cce262f9e97559313ea593dc73a8e (patch)
tree0df230d8d8b881fc07a6291e9a21f143562946f1
parent35723f09bb4e04e882f584c13f6b34cd175f5d3a (diff)
downloadbcm5719-llvm-222b30b9d39cce262f9e97559313ea593dc73a8e.tar.gz
bcm5719-llvm-222b30b9d39cce262f9e97559313ea593dc73a8e.zip
Stop asserting when a meaningless -std= flag is passed for a non-compilation
input kind; go back to silently ignoring the flag. llvm-svn: 295122
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
-rw-r--r--clang/test/Driver/unknown-std.S2
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 3001a2dda46..2ef96398c0d 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -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/clang/test/Driver/unknown-std.S b/clang/test/Driver/unknown-std.S
new file mode 100644
index 00000000000..ecb6a9e92fa
--- /dev/null
+++ b/clang/test/Driver/unknown-std.S
@@ -0,0 +1,2 @@
+// RUN: %clang -std=c++11 %s -E -o /dev/null 2>&1 | FileCheck %s --allow-empty
+// CHECK-NOT: error
OpenPOWER on IntegriCloud