OSDN Git Service

PR c++/52685
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / memfriend5.C
1 // { dg-do compile }
2
3 // Copyright (C) 2003 Free Software Foundation
4 // Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
5
6 // Member template function of member class template as friend
7
8 template <class T> struct A {
9   template <class U> struct B {
10     template <class V> void f(V);
11   };
12 };
13
14 class X {
15   int i;
16   template <class T> template <class U> template <class V>
17     friend void A<T>::B<U>::f(V);
18 };
19
20 template <class T> template <class U> template <class V>
21   void A<T>::B<U>::f(V)
22 {
23   X x;
24   x.i = 0;
25 }
26
27 int main()
28 {
29   A<char>::B<char> a1;
30   a1.f(0);
31 }