2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / template / memfriend6.C
blob21d799605ec9df662f04453bb8123e95fd647be6
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
7 // Erroneous case: mismatch during declaration
9 template <class T> struct A {
10   template <class U> void f(U);         // { dg-error "candidate" }
11   void g();                             // { dg-error "candidate" }
12   void h();                             // { dg-error "candidate" }
13   void i(int);                          // { dg-error "candidate" }
16 class C {
17   int ii;
18   template <class U> friend void A<U>::f(U);    // { dg-error "not match" }
19   template <class U> template <class V>
20     friend void A<U>::g();                      // { dg-error "not match" }
21   template <class U> friend int A<U>::h();      // { dg-error "not match" }
22   template <class U> friend void A<U>::i(char); // { dg-error "not match" }