Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Failure to compile std::u16string from libstdc++ 12.1 in c++20 mode #55560

Closed
@patstew

Description

@patstew

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::u16stringprint() {returnstd::u16string(sv); }intmain(int,char**) { std::u16string s =print(); }

on clang 13 and 14.0.0, withclang++ -std=c++20 -o test test.cpp. It works fine with-std=c++17. Bizarrely, it also works if you simply uncomment theclang_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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp