PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / pr84979-2.C
blobce69a0f8ac53169865de422d55d2a4536415c83f
1 // { dg-do compile { target c++11 } }
2 // { dg-options "-fconcepts" }
4 template <typename T>
5 void foo1(T& t) {
6   typename T::template C<void> tcv = t;
7   typename T::template C<auto> u = tcv;
8   T::template C<auto>::f (tcv, u); // { dg-error "incomplete" }
9   (typename T::template D<auto> (t)); // { dg-error "invalid" }
12 struct T1 {
13   template <typename T> struct C {
14     C(T1&);
15     static void f(T1&, C&);
16   };
17   template <typename T> struct D {
18     D(T1&);
19   };
22 template <typename T>
23 void foo2(T& t) {
24   typename T::template C<void> tcv = t;
25   typename T::template C<auto> u = tcv;
26   T::template C<auto>::f (tcv, u); // { dg-error "incomplete" }
27   T::template D<auto> (t); // { dg-error "invalid" }
30 struct T2 {
31   template <typename T> struct C {
32     C(T2&);
33     static void f(T2&, C&);
34   };
35   template <typename T> static void D(T2&);
38 void f(T1& t1, T2& t2) {
39   foo1 (t1);
40   foo2 (t2);