OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [lookup19.C] - Blame information for rev 823

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.