summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Frontend/InitHeaderSearch.cpp4
-rw-r--r--clang/test/Frontend/nostdlib-for-asmpp.s5
2 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Frontend/InitHeaderSearch.cpp b/clang/lib/Frontend/InitHeaderSearch.cpp
index 85aeec461ba..8a70404629d 100644
--- a/clang/lib/Frontend/InitHeaderSearch.cpp
+++ b/clang/lib/Frontend/InitHeaderSearch.cpp
@@ -470,8 +470,8 @@ void InitHeaderSearch::AddDefaultIncludePaths(const LangOptions &Lang,
break;
}
- if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes &&
- HSOpts.UseStandardSystemIncludes) {
+ if (Lang.CPlusPlus && !Lang.AsmPreprocessor &&
+ HSOpts.UseStandardCXXIncludes && HSOpts.UseStandardSystemIncludes) {
if (HSOpts.UseLibcxx) {
if (triple.isOSDarwin()) {
// On Darwin, libc++ may be installed alongside the compiler in
diff --git a/clang/test/Frontend/nostdlib-for-asmpp.s b/clang/test/Frontend/nostdlib-for-asmpp.s
new file mode 100644
index 00000000000..330fee32a36
--- /dev/null
+++ b/clang/test/Frontend/nostdlib-for-asmpp.s
@@ -0,0 +1,5 @@
+// RUN: %clang -cc1 -x assembler-with-cpp -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist -std=c++11 -v %s 2>&1 | FileCheck %s
+// The C++ stdlib path should not be included for an assembly source.
+
+// CHECK-NOT: usr/include/c++/
+// CHECK-NOT: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead
OpenPOWER on IntegriCloud