OSDN Git Service

2009-10-05 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / lookup / koenig5.C
1 // Koenig lookup is not defined as intended in the std.  DR 218 gives
2 // an indication of what is meant.  This test case encapsulates the
3 // current conservative behaviour
4
5 // Copyright (C) 2006 Free Software Foundation, Inc.
6 // Contributed by Nathan Sidwell 27 Aug 2006 <nathan@codesourcery.com>
7
8 namespace N
9 {
10   struct A {};
11   void One (...);  // { dg-error "conflict with" "" }
12   void (*Two) (...);  // { dg-error "not a function" "" }
13   namespace Three {} // { dg-error "lookup finds|not a function" "" }
14 }
15
16 namespace M
17 {
18   struct B {};
19   struct One {};  // { dg-error "lookup finds|not a function" "" }
20   void (*Two) (...);  // { dg-error "conflict with" "" }
21   void Three (...);  // { dg-error "conflict with" "" }
22 }
23
24 namespace O 
25 {
26   struct C {};
27   void Two (...); // { dg-error "conflict with" "" }
28 }
29   
30 void g (N::A *a, M::B *b, O::C *c)
31 {
32   One (a); // ok
33   One (b); // { dg-error "in call to" "" }
34   One (a, b); // { dg-error "in call to" "" }
35
36   Two (a); // ok
37   Two (a, a); // ok
38   Two (b); // ok
39   Two (c); // ok
40   Two (a, b); // { dg-error "in call to" "" }
41   Two (a, c); // { dg-error "in call to" "" }
42   
43   Three (a); // { dg-error "in call to" "" }
44   Three (b); // ok
45   Three (a, b); // { dg-error "in call to" "" }
46 }