[llvm-bugs] [Bug 42676] New: Link error with _LIBCPP_HIDE_FROM_ABI_PER_TU

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 18 12:29:39 PDT 2019


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

            Bug ID: 42676
           Summary: Link error with _LIBCPP_HIDE_FROM_ABI_PER_TU
           Product: libc++
           Version: 9.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ldionne at apple.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

The following code produces a link error:

$ cat <<EOF | clang++ -xc++ -std=c++14 - -D_LIBCPP_HIDE_FROM_ABI_PER_TU
#include <memory>
#include <string>

int main() {
    std::string s(10u, '-', std::allocator<char>());
    (void)s;
}
EOF

Output:

Undefined symbols for architecture x86_64:
  "std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >::basic_string(unsigned long, char,
std::__1::allocator<char> const&)", referenced from:
      _main in --68d1cd.o

Live repro: https://wandbox.org/permlink/EWKWqwBbq3bpNhr3


The problem happens in C++03/C++11/C++14.

-- 
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/20190718/f7274219/attachment.html>


More information about the llvm-bugs mailing list