https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109680
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Ah, I think I see what's going on here. Once again, the problem is that this assert no longer passes: #include <utility> static_assert (!std::is_convertible_v <int () const, int (*) ()>, ""); std::is_convertible does To test() { return std::declval<From>(); } here, From is 'int () const'. std::declval is defined as: template<class T> typename std::add_rvalue_reference<T>::type declval() noexcept; Now, std::add_rvalue_reference is defined as "If T is a function type that has no cv- or ref- qualifier or an object type, provides a member typedef type which is T&&, otherwise type is T." In our case, T is cv-qualified, so the result is T, so we end up with int () const declval() noexcept; which is invalid. In other words: using T = int () const; T fn1(); // bad, fn returning a fn T& fn2(); // bad, cannot declare reference to qualified function type T* fn3(); // bad, cannot declare pointer to qualified function type using U = int (); U fn4(); // bad, fn returning a fn U& fn5(); // OK U* fn6(); // OK So the check we're looking for is probably if (TREE_CODE (type) == FUNCTION_TYPE && (type_memfn_quals (type) != TYPE_UNQUALIFIED || type_memfn_rqual (type) != REF_QUAL_NONE)) but I think it should be put wherever we simulate declval().