[PATCH v4] libstdc++: Use allocate_at_least in vector, string (P0401) [PR118030]

Stephan Bergmann sberg.fun@gmail.com
Tue May 26 05:35:47 GMT 2026


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)



More information about the Libstdc++ mailing list