Because https://reviews.llvm.org/rL336132 introduces a few function templates with default template arguments, gcc cannot compile <string> anymore, when targeting c++03 or earlier: $ echo "#include <string>" | g++ -std=c++03 -nostdinc++ -isystem /usr/include/c++/v1 -x c++ -c - -o - In file included from <stdin>:1: /usr/include/c++/v1/string:812:35: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11 basic_string(const _CharT* __s) { ^ /usr/include/c++/v1/string:822:62: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11 basic_string(const _CharT* __s, const _Allocator& __a); ^ /usr/include/c++/v1/string:833:70: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11 basic_string(size_type __n, _CharT __c, const _Allocator& __a); ^ /usr/include/c++/v1/string:844:75: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11 const allocator_type& __a = allocator_type()); ^ /usr/include/c++/v1/string:848:45: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11 explicit basic_string(const _Tp& __t); ^ /usr/include/c++/v1/string:852:72: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11 explicit basic_string(const _Tp& __t, const allocator_type& __a); ^ /usr/include/c++/v1/string:875:43: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11 basic_string& operator=(const _Tp& __t) ^ Apparently gcc in c++03 mode does accept class templates with default arguments, but not function templates. https://reviews.llvm.org/D48616 already stated "I may have stepped on a bug fix for old versions of gcc in C++03 mode - Eric? [ was introduced in r292830 ]", and indeed it looks like this has happened.
Btw, this was with gcc 8.2.0, but it also happens with g++ 9.0.0 20180826 (experimental), so I think it is intentional on the part of the gcc authors.
I tried moving the template parameters into function parameters, keeping the enable_if bits. That didn't work - introduced ambiguity.
Partial fix up for review at: https://reviews.llvm.org/D52240
Hm, this appears to be more difficult than I thought... :)
Committed revision 344616 as a partial fix.
We explicitly do not support GCC in C++03 mode anymore, so I'm closing this as WONTFIX.