ARTICLE AD BOX
Completely minimal source:
#include <string> int main() { std::string S; }When I try to compile it with GCC 15.2.1 and flags -std=c++17 -fconcepts -fsanitize=undefined -O2, I get an undefined reference to the symbol _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EvQ26is_default_constructible_vIT1_E (whole error, nothing more from the linker). As I understand, that's the mangled form of the constructor std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::basic_string() [with T = char, std::is_default_constructible_v<T> = true], though c++filt can't demangle it.
The linker error goes away when removing the sanitizer, switching to -O0 (but not -O1), removing -fconcepts or switching to C++14 or C++20. I can't try to replicate it on Compiler Explorer since it doesn't have this GCC version yet, but with 15.2.0 this error also goes away - I assume it's specific to 15.2.1 especially since I haven't encountered it before. GCC is installed from Arch Linux repos and the linked /usr/lib/libubsan.so.1 is also from those repos, package gcc-libs 15.2.1 - nothing off there.
I don't know if I tried something I'm not supposed to or if this is a compiler bug. What's causing this linker error?
