https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115746
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
BTW, with a modified version of fold-constr5.C which doesn't involve any fold
expanded constraints:
struct A {
using type = int;
};
struct B {
using type = long;
};
template <class T> concept C = true;
template <class T, class U> requires (C<typename U::type> && C<typename
T::type>) // { dg-error "is not a class, struct, or union type" }
constexpr bool bar () { return true; };
static_assert (bar <A, B> ());
static_assert (bar <int, int> ()); // { dg-error "no matching function for
call" }
static_assert (bar <B, long> ()); // { dg-error "no matching function for
call" }
static_assert (bar <unsigned, A> ()); // { dg-error "no matching function for
call" }
template <class T, class U> requires (C<typename T::type> && C<typename
U::type>) // { dg-error "is not a class, struct, or union type" }
constexpr bool baz () { return true; };
static_assert (baz <B, A> ());
static_assert (baz <int, long> ()); // { dg-error "no matching function for
call" }
static_assert (baz <B, long> ()); // { dg-error "no matching function for
call" }
static_assert (baz <unsigned, A> ()); // { dg-error "no matching function for
call" }
template <class T, class U> requires (C<typename U::type> || C<typename
T::type>) // { dg-error "is not a class, struct, or union type" }
constexpr bool corge () { return true; };
static_assert (corge <B, A> ());
static_assert (corge <int, int> ()); // { dg-error "no matching function for
call" }
static_assert (corge <B, long> ());
static_assert (corge <unsigned, A> ());
template <class T, class U> requires (C<typename T::type> || C<typename
U::type>) // { dg-error "is not a class, struct, or union type" }
constexpr bool garply () { return true; };
static_assert (garply <B, A> ());
static_assert (garply <int, int> ()); // { dg-error "no matching function for
call" }
static_assert (garply <B, long> ());
static_assert (garply <unsigned, A> ());
g++ accepts all of this without any errors (tried 10.1, 11.1, 12.1, 13.1, 14.1
and trunk), while clang++ rejects it at the dg-error lines;
and my (sure, limited) understanding suggests that it should not be satisfied.