https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80265
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I don't think it works that well. Consider: int str6 (int a) { char s[] = "strabcdefgh"; s[2] = a; return ce_char_traits<char>::length(s); } int str7 (int a) { char s[] = "strabcdefgh"; s[2] = a; return __builtin_strlen(s); } The latter is compiled into standard strlen sequence, depending on tuning etc., the former is always the constexpr_strlen loop at runtime.