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 { // { dg-message "defined here" }
10 template <class U> void f(U); // { dg-message "candidate" }
11 void g(); // { dg-message "candidate" }
12 void h(); // { dg-message "candidate" }
13 void i(int); // { dg-message "candidate" }
19 friend void A<U>::f(U); // { dg-error "no declaration matches" }
20 template <class U> template <class V>
21 friend void A<U>::g(); // { dg-error "no declaration matches" }
23 friend int A<U>::h(); // { dg-error "no declaration matches" }
25 friend void A<U>::i(char); // { dg-error "no declaration matches" }