https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80811
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- There are typos in the example in comment #0. Here's what it should look like: #include <string> void cmp (const std::string &s1, const std::string &s2) { int c1 = s1.compare (s2); int c2 = s1.compare (s2); if (c1 != c2) __builtin_abort (); } void cmp (const std::string &str, const char *s) { int c1 = str.compare (s); int c2 = str.compare (s); if (c1 != c2) __builtin_abort (); }