[llvm-bugs] [Bug 49855] New: cannot control search path order with -stdlib=libc++

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 5 23:55:21 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=49855

            Bug ID: 49855
           Summary: cannot control search path order with -stdlib=libc++
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yichen.yan at inf.ethz.ch
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

-stdlib=libc++ will `push_back` to the search path and I met few packages that
will fail due to this.
I understand this should be fixed in the build system of the packages for
misuse `-I`, but do you think a small revision in clang would be helpful?


minimal repro:

root at cc6f61d60963:/test# cat test.cc
#include <cstddef>
root at cc6f61d60963:/test# cat version
user-defined-context
root at cc6f61d60963:/test# /llvm-install/bin/clang++ -stdlib=libc++ -I. -c
test.cc -o /dev/null
In file included from test.cc:1:
In file included from /llvm-install/bin/../include/c++/v1/cstddef:37:
./version:1:1: error: unknown type name 'user'
user-defined-context
^
./version:1:5: error: expected unqualified-id
user-defined-context
    ^
In file included from test.cc:1:
/llvm-install/bin/../include/c++/v1/cstddef:49:9: error: no member named
'ptrdiff_t' in the global namespace
using ::ptrdiff_t;
      ~~^
3 errors generated.
root at cc6f61d60963:/test# /llvm-install/bin/clang++ -nostdinc++
-I/llvm-install/include/c++/v1 -I. -c test.cc -o /dev/null
root at cc6f61d60963:/test# /llvm-install/bin/clang++ -stdlib=libc++ -nostdinc++
-I/llvm-install/include/c++/v1 -I. -c test.cc -o /dev/null
clang-13: warning: argument unused during compilation: '-stdlib=libc++'
[-Wunused-command-line-argument]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210406/e4536875/attachment-0001.html>


More information about the llvm-bugs mailing list