[PATCH] D48736: [frontend] Don't include the C++ stdlib for -x assembler-with-cpp

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 28 16:28:31 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC335940: [frontend] Don't include the C++ stdlib for -x assembler-with-cpp (authored by arphaman, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D48736?vs=153368&id=153420#toc

Repository:
  rC Clang

https://reviews.llvm.org/D48736

Files:
  lib/Frontend/InitHeaderSearch.cpp
  test/Frontend/nostdlib-for-asmpp.s


Index: test/Frontend/nostdlib-for-asmpp.s
===================================================================
--- test/Frontend/nostdlib-for-asmpp.s
+++ 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
Index: lib/Frontend/InitHeaderSearch.cpp
===================================================================
--- lib/Frontend/InitHeaderSearch.cpp
+++ lib/Frontend/InitHeaderSearch.cpp
@@ -470,8 +470,8 @@
     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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48736.153420.patch
Type: text/x-patch
Size: 1174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180628/a7598641/attachment.bin>


More information about the cfe-commits mailing list