OSDN Git Service

* typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.other / lookup19.C
1 // { dg-do assemble  }
2 // Test for proper handling of type lookup for conversion operator names.
3
4 // Test 1: Only at file scope
5 typedef int B;
6 struct A
7 {
8   int B;
9   operator B *(); // { dg-error "" } 
10 };
11
12 A::operator B * () // { dg-error "" } 
13 {
14   return 0;
15 }
16
17 // Test 2: Only at class scope
18 struct C
19 {
20   typedef int D;
21   operator D *();
22 };
23
24 int D;
25 C::operator D * ()
26 {
27   return 0;
28 }
29
30 // Test 3: Matching
31 struct E
32 {
33   typedef int F;
34   operator F *();
35 };
36
37 typedef int F;
38 E::operator F * ()
39 {
40   return 0;
41 }
42
43 // Test 4: Conflicting
44 struct G
45 {
46   typedef int H;
47   operator H *();
48 };
49
50 typedef double H;
51 G::operator H * ()
52 {
53   return 0;
54 }