// { dg-do compile { target c++11 } } // { dg-options "-fconcepts" } // This is like pr84979-2.C, except that we swap the types passed to // the template functions foo1 and foo2, so that the expectations WRT // D's typeness are not met. template void foo1(T& t) { typename T::template C tcv = t; typename T::template C u = tcv; T::template C::f (tcv, u); // { dg-error "incomplete" } (typename T::template D (t)); // { dg-error "invalid" } } struct T1 { template struct C { C(T1&); static void f(T1&, C&); }; template struct D { D(T1&); }; }; template void foo2(T& t) { typename T::template C tcv = t; typename T::template C u = tcv; T::template C::f (tcv, u); // { dg-error "incomplete" } T::template D (t); // { dg-error "yields a type" } } struct T2 { template struct C { C(T2&); static void f(T2&, C&); }; template static void D(T2&); }; void f(T1& t1, T2& t2) { foo1 (t2); foo2 (t1); }