PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / template / memfriend3.C
blob3ea8c84cf25164be0925064e64f75929e32bcce4
1 // { dg-do compile }
3 // Copyright (C) 2003 Free Software Foundation
4 // Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
6 // Member function of class template as friend
8 template<class T> struct A
10   void f(T);
13 class C {
14   int i;
15   template<class T> friend void A<T>::f(T);
18 template<class T> struct A<T*>
20   void f(T*);
23 template<> struct A<char>
25   void f(char);
28 template<class T> void A<T>::f(T)
30   C c;
31   c.i = 0;
34 template<class T> void A<T*>::f(T*)
36   C c;
37   c.i = 0;
40 void A<char>::f(char)
42   C c;
43   c.i = 0;
46 int main()
48   A<int> a1;
49   a1.f(0);
50   A<int *> a2;
51   int *p = 0;
52   a2.f(p);
53   A<char> a3;
54   a3.f('a');