blob: 7c56d5cbc5e1f9df26cd5ed14d2494313f364ab3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// { dg-do assemble }
// Function pointers are ignored in Koenig lookup. (DR 218)
namespace A{
void foo();
struct X{};
void (*bar)(X*)=0; // { dg-message "A::bar" }
}
using A::X;
void (*foo)(X*)=0;
void g()
{
foo(new X); // ok -- DR 218 says that we find the global
// foo variable first, and therefore do not
// perform argument-dependent lookup.
bar(new X); // { dg-error "not declared" }
// { dg-message "suggested alternative" "suggested alternative" { target *-*-* } 17 }
}
|