Debian Codegraph @

gcc/testsuite/g++.dg/template/memfriend6.C

raw
1 // { dg-do compile }
2
3 // Copyright (C) 2003 Free Software Foundation
4 // Contributed by Kriang Lerdsuwanakij <[email protected]>
5
6 // Member function of class template as friend
7 // Erroneous case: mismatch during declaration
8
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" }
14 };
15
16 class C {
17 int ii;
18 template <class U>
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" }
22 template <class U>
23 friend int A<U>::h(); // { dg-error "no declaration matches" }
24 template <class U>
25 friend void A<U>::i(char); // { dg-error "no declaration matches" }
26 };