gcc/testsuite/g++.dg/diagnostic/friend2.C
raw| 1 | // PR c++/61490 |
| 2 | // { dg-do compile } |
| 3 | |
| 4 | namespace N { void f (); } |
| 5 | void f2 (); |
| 6 | |
| 7 | struct A { |
| 8 | friend void N::f () { } // { dg-error "15:friend function definition 'f' cannot have a name qualified with 'N::'" } |
| 9 | friend void ::f2 () { } // { dg-error "15:friend function definition 'f2' cannot have a name qualified with '::'" } |
| 10 | }; |