On Sun, 13 Nov 2022, 19:23 Stephan Bergmann via Libstdc++, < libstd...@gcc.gnu.org> wrote:
> On 11/12/22 03:47, Jonathan Wakely wrote: > > On Fri, 11 Nov 2022 at 21:00, Stephan Bergmann <sberg...@redhat.com> > wrote: > >> > >> On 11/11/22 06:30, Jonathan Wakely via Gcc-patches wrote: > >>> As discussed in the PR, this makes it three times faster to construct > >>> iostreams objects. > >>> > >>> Tested x86_64-linux. Pushed to trunk. > >> > >> I haven't yet tried to track down what's going on, but with various > >> versions of Clang (e.g. clang-15.0.4-1.fc37.x86_64): > >> > >>> $ cat test.cc > >>> #include <regex> > >>> int main(int, char ** argv) { > >>> std::regex_traits<char>().transform(argv[0], argv[0] + 1); > >>> } > >> > >>> $ clang++ --gcc-toolchain=... -fsanitize=undefined -O2 test.cc > >>> /usr/bin/ld: /tmp/test-c112b1.o: in function > `std::__cxx11::basic_string<char, std::char_traits<char>, > std::allocator<char> > > std::__cxx11::regex_traits<char>::transform<char*>(char*, char*) const': > >>> > test.cc:(.text._ZNKSt7__cxx1112regex_traitsIcE9transformIPcEENS_12basic_stringIcSt11char_traitsIcESaIcEEET_S9_[_ZNKSt7__cxx1112regex_traitsIcE9transformIPcEENS_12basic_stringIcSt11char_traitsIcESaIcEEET_S9_]+0x1b): > undefined reference to `std::__cxx11::collate<char> const* > std::__try_use_facet<std::__cxx11::collate<char> >(std::locale const&)' > >>> clang-15: error: linker command failed with exit code 1 (use -v to see > invocation) > > > > That should be present, andis present in my builds: > > > > _ZSt15__try_use_facetINSt7__cxx117collateIcEEEPKT_RKSt6locale > > std::__cxx11::collate<char> const* > > std::__try_use_facet<std::__cxx11::collate<char> >(std::locale const&) > > version status: compatible > > GLIBCXX_3.4.31 > > type: function > > status: added > > > > Was this a clean build, or incremental? I'm guessing the latter. > > Yes, indeed. And a full rebuild fixed the issue for me. > Ah good. > Sorry for the noise. > No problem, you do a good job of keeping us working well with clang.