https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63220
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- First of all you should mark the functions 'inline' as well. Then the issue is that 'eq' is called indirectly which isn't allowed for always_inline functions: t.C:81:66: error: inlining failed in call to always_inline 'static constexpr bool std::__1::char_traits<char>::eq(std::__1::char_traits<char>::char_type, std::__1::char_traits<char>::char_type)': indirect function call with a yet undetermined callee __attribute__ (( __always_inline__)) static constexpr bool eq(char_type __c1, char_type __c2) { ^ t.C:75:37: error: called from here if (!__pred(*__m1, *__m2)) { } ^ which means this is a missed-optimization only. The error is your fault. Note that getting the error is unreliable so -O0 simply doesn't discover the failed inlining.