https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88977
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- I had missed the example is missing a semicolon after the definition of X (the error could use improvement). With the semicolon added, the example is accepted (it's even in the test suite). The equivalent that isn't accepted but I believe should be is the following: $ cat pr88977.C && gcc -S -Wall pr88977.C template <bool B> constexpr bool f() { return B; } static_assert (f<__builtin_is_constant_evaluated()>()); pr88977.C:2:53: error: no matching function for call to ‘f<__builtin_is_constant_evaluated()>()’ 2 | static_assert (f<__builtin_is_constant_evaluated()>()); | ^ pr88977.C:1:34: note: candidate: ‘template<bool B> constexpr bool f()’ 1 | template <bool B> constexpr bool f() { return B; } | ^ pr88977.C:1:34: note: template argument deduction/substitution failed: