OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.ns / overload1.C
1 // { dg-do run  }
2 // Unqualified lookup should find all functions.
3 // Duplicates are ignored as long as they lose during overload resolution.
4 namespace A{
5   int f(){
6     return 1;
7   }
8   int f(double);
9 }
10 namespace B{
11   int f(int){
12     return 2;
13   }
14   int f(double);
15 }
16
17 int f(int,int)
18 {
19   return 3;
20 }
21
22 using namespace A;
23 using namespace B;
24
25 int main()
26 {
27   if(f() != 1)
28     return 1;
29   if(f(1) != 2)
30     return 1;
31   if(f(0,0) != 3)
32     return 1;
33   return 0;
34 }