https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89728
Bug ID: 89728 Summary: ctype is underconstrained Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Because of that overloads from [locale.convenience] compile well with creepy charT template arguments like std::string: std::tolower(std::string{}, std::locale::classic()); That leads to runtime exceptions (bad cast to ctype<basic_string<char>>) instead of a compile time. Some other standard library implementations are more restrictive and do not allow such weird template parameters for ctype: error: implicit instantiation of undefined template 'std::__1::ctype<std::__1::basic_string<char> >'