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)