Hi Jonathan,
> On Sat, 4 Apr 2026, 17:26 Tomasz Kamiński, <[email protected]> wrote:
>
>> The C++20 standard added new starts_with and ends_with members to
>> std::basic_string, which were not previously instantiated in the library.
>> This meant that the extern template declarations had to be disabled for
>> C++20 mode. With this patch the new members are instantiated in the
>> library and so the explicit instantiation declarations can be used for
>> C++20.
>>
>> Furthermore, basic_string default constructor is now constrained with
>> is_default_constructible_v<_Alloc> constrains, that is included in
>> mangled name, so we also need to instantiate and export it.
>>
>> The new members added by C++23 are still not exported, and so the
>> explicit instantiation declarations are still disabled for C++23.
>>
>> libstdc++-v3/ChangeLog:
>>
>> * config/abi/pre/gnu.ver (GLIBCXX_3.4): Make string exports
>> less greedy.
>> (GLIBCXX_3.4.26): Export basic_string default constructor and
>> starts_with and ends_with members.
>> * include/bits/basic_string.h: Update __cpluplus checks for C++20.
>> * include/bits/cow_string.h: Likewise.
>> * include/bits/basic_string.tcc: Declare explicit instantiations
>> for C++20 as well as earlier dialects.
>> * src/c++20/Makefile.am: Add cow-string-inst.cc and
>> string-inst.cc source files.
>> * src/c++20/Makefile.in: Regenerate.
>> * src/c++20/string-inst.cc: New file defining explicit
>> instantiations for basic_string default constructor and
>> starts_with,
>> ends_with methods added in C++20
>> * src/c++20/cow-string-inst.cc: Version of above for cow-stings.
>>
>> Reviewed-by: Jonathan Wakely <[email protected]>
>> Signed-off-by: Tomasz Kamiński <[email protected]>
>> ---
>> v2 updates the years in copyright and standard reference,
>> as suggested.
>>
>> Tested after Jakub's fix for PR124754 on x86_64-linux,
>> and all test passed. Same for test -O0.
>> OK for trunk?
>>
>
> OK, thanks
this patch broke Solaris bootstrap:
ld: fatal: libstdc++-symbols.ver-sun: 3753: symbol '_ZNKSs11_M_disjunctEPKc':
symbol version conflict
ld: fatal: libstdc++-symbols.ver-sun: 3765: symbol
'_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw': symbol version conflict
Both symbols now match GLIBCXX_3.4 and GLIBCXX_3.4.5.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University