[PATCH v4] libstdc++: Use allocate_at_least in vector, string (P0401) [PR118030]
Stephan Bergmann
sberg.fun@gmail.com
Tue May 26 07:04:14 GMT 2026
On 5/26/26 07:44, Nathan Myers wrote:
> On 5/26/26 1:35 AM, Stephan Bergmann wrote:
>> At least with clang-22.1.5-1.fc44.x86_64 and with recent Clang 23
>> trunk, this started to fail
>>
>>> $ cat test.cc
>>> #include <string>
>>> int main(int argc, char **) {
>>> char buf[32] = {};
>>> return std::string(buf, buf + argc + 20).size();
>>> }
>>
>>> $ clang++ --gcc-install-dir=/home/sberg/gcc/inst/lib/gcc/x86_64-pc-
>>> linux-gnu/17.0.0 -O1 test.cc
>>> /usr/bin/ld.bfd: /tmp/test-caae58.o: in function `main':
>>> test.cc:(.text+0x32): undefined reference to
>>> `std::__cxx11::basic_string<char, std::char_traits<char>,
>>> std::allocator<char> >::_M_create_plus(unsigned long, unsigned long)'
>>> clang++: error: linker command failed with exit code 1 (use -v to see
>>> invocation)
>
> Thank you.
>
> Is your version of Clang picking up symbols declared in section
> GLIBCXX_3.4.36 of config/abi/pre/gnu.ver ? Using libstdc++.so
> built with the object linked in?
>
> That section is targetted at unreleased GCC 17.
Oh, sorry, my bad: This was an incremental build of GCC. With a
from-scratch one, everything's fine again!
More information about the Libstdc++
mailing list