summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/lookup19.C
blob: d4104f0fca53bbd9f57e63144bafa7775d3a9a62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// { dg-do assemble  }
// Test for proper handling of type lookup for conversion operator names.

// Test 1: Only at file scope
typedef int B;
struct A
{
  int B;
  operator B *(); // { dg-error "" } 
};

A::operator B * () // { dg-error "" } 
{
  return 0;
}

// Test 2: Only at class scope
struct C
{
  typedef int D;
  operator D *();
};

int D;
C::operator D * ()
{
  return 0;
}

// Test 3: Matching
struct E
{
  typedef int F;
  operator F *();
};

typedef int F;
E::operator F * ()
{
  return 0;
}

// Test 4: Conflicting
struct G
{
  typedef int H;
  operator H *();
};

typedef double H;
G::operator H * ()
{
  return 0;
}