PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / template / friend31.C
blob2be5600810e01fb23fe00e05d51e4420bd090e88
1 // { dg-do compile }
3 // Origin: Ivan Godard <igodard@pacbell.net>
5 // PR c++/15410: Declaration of friend class template with wrong
6 // template parameter.
8 template <typename T, typename U> struct F; // { dg-message "previous declaration" }
10 class W
12   template<int i> friend class F;       // { dg-error "template parameter" }
13   int x;                                // { dg-message "private" }
16 template <typename T, typename U> struct F
18   void Look(W& w) { w.x = 3; }          // { dg-error "within this context" }
21 int main()
23   W w;
24   F<char, bool> f;
25   f.Look(w);
26   return 0;