// PR c++/95303 // { dg-do compile { target c++20 } } template struct A { struct B {}; }; template requires __is_same(T, char) struct A { struct B {}; }; template<> struct A { struct B {}; }; template concept C = requires (T&& t) { // { dg-message "\\\[with T = A::B\\\]" } t.a; }; static_assert(C::B>); // { dg-error "failed" } template concept D = requires (T&& t) { // { dg-message "\\\[with T = A::B\\\]" } t.a; }; static_assert(D::B>); // { dg-error "failed" } template concept E = requires (T&& t) { // { dg-message "\\\[with T = A::B\\\]" } t.a; }; static_assert(E::B>); // { dg-error "failed" }