FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / lookup19.C
blob12663e701eb2b7891b5017f75ad01494017f3619
1 // Test for proper handling of type lookup for conversion operator names.
2 // Build don't link:
4 // Test 1: Only at file scope
5 typedef int B;
6 struct A
8   int B;
9   operator B *(); // ERROR - 
12 A::operator B * () // ERROR - 
14   return 0;
17 // Test 2: Only at class scope
18 struct C
20   typedef int D;
21   operator D *();
24 int D;
25 C::operator D * ()
27   return 0;
30 // Test 3: Matching
31 struct E
33   typedef int F;
34   operator F *();
37 typedef int F;
38 E::operator F * ()
40   return 0;
43 // Test 4: Conflicting
44 struct G
46   typedef int H;
47   operator H *();
50 typedef double H;
51 G::operator H * ()
53   return 0;