-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Labels
c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"libstdc++GNU libstdc++ C++ standard libraryGNU libstdc++ C++ standard libraryrejects-validrelease:backportrelease:merged
Milestone
Description
I'm getting:
error: undefined symbol: void std::__cxx11::basic_string<char16_t, std::char_traits<char16_t>, std::allocator<char16_t> >::_M_construct<char16_t const*>(char16_t const*, char16_t const*, std::forward_iterator_tag)compiling the following simple test case:
#include <string>
#include <string_view>
// static std::u16string clang_string_workaround(const char16_t* a, const char16_t* b) { return {a, b}; }
std::u16string_view sv{u"test"};
std::u16string print() { return std::u16string(sv); }
int main(int, char**) { std::u16string s = print(); }on clang 13 and 14.0.0, with clang++ -std=c++20 -o test test.cpp. It works fine with -std=c++17. Bizarrely, it also works if you simply uncomment the clang_string_workaround line which isn't even called. It looks like libstdc++ moved that _M_construct function into a separate file recently, which might be related.
Fedr
Metadata
Metadata
Assignees
Labels
c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"libstdc++GNU libstdc++ C++ standard libraryGNU libstdc++ C++ standard libraryrejects-validrelease:backportrelease:merged
Type
Projects
Status
Done