https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113713
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- C++11 testcase so it is easier to test against older versions of GCC: ``` struct A{}; template<class T> constexpr bool p(T) { return false; } template<class T> constexpr bool f(T v) { return p(v); } constexpr bool g() { return f(A()); } constexpr bool p(A) { return true; } void ff() { static_assert( f(A{}) , ""); } ``` GCC 6 and before causes the static_assert to always to fail at all optimizations level. GCC 7 and afterwards has the current behavior of true for -O0 and false for -O1 and above.