OSDN Git Service

6ecc25daadb9ac8a60e7581ce1fd8a8b8260b829
[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 (...);
12   void (*Two) (...);
13   namespace Three {}
14 }
15
16 namespace M
17 {
18   struct B {};
19   struct One {};
20   void (*Two) (...);
21   void Three (...);
22 }
23
24 namespace O 
25 {
26   struct C {};
27   void Two (...);
28 }
29   
30 void g (N::A *a, M::B *b, O::C *c)
31 {
32   One (a); // ok
33   One (a, b); // ok
34   One (b); // { dg-error "not declared" }
35
36   Two (c); // ok
37   Two (a, c); // ok
38   Two (a); // { dg-error "not declared" }
39   Two (a, a); // error masked by earlier error
40   Two (b); // error masked by earlier error
41   Two (a, b); // error masked by earlier error
42   
43   Three (b); // ok
44   Three (a, b); // ok
45   Three (a); // { dg-error "not declared" }
46 }