Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.ns/koenig5.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do assemble } |
2 // Function pointers are ignored in Koenig lookup. (DR 218) | |
3 namespace A{ | |
4 void foo(); | |
5 struct X{}; | |
6 void (*bar)(X*)=0; // { dg-message "A::bar" } | |
7 } | |
8 using A::X; | |
9 | |
10 void (*foo)(X*)=0; | |
11 | |
12 void g() | |
13 { | |
14 foo(new X); // ok -- DR 218 says that we find the global | |
15 // foo variable first, and therefore do not | |
16 // perform argument-dependent lookup. | |
145 | 17 bar(new X); // { dg-error "3:'bar' was not declared in this scope; did you mean 'A::bar'" } |
111 | 18 } |