OSDN Git Service

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