gcc/testsuite/g++.dg/lookup/friend19.C
raw| 1 | // Make sure unhiding friends doesn't unhide similarly named friends |
| 2 | |
| 3 | struct X |
| 4 | { |
| 5 | friend int foo (X); |
| 6 | }; |
| 7 | |
| 8 | struct Y |
| 9 | { |
| 10 | friend int foo (Y); |
| 11 | }; |
| 12 | |
| 13 | void Baz () |
| 14 | { |
| 15 | foo (X()); |
| 16 | foo (Y()); |
| 17 | } |
| 18 | |
| 19 | int foo (Y); |
| 20 | int foo (int); |
| 21 | // foo(X) still hidden |
| 22 | |
| 23 | void Bar () |
| 24 | { |
| 25 | foo (X()); |
| 26 | foo (Y()); |
| 27 | ::foo (X()); // { dg-error "" } |
| 28 | ::foo (Y()); |
| 29 | } |