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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [inherit/] [conv3.C] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// PR 31074
2
// Bug: The reference cast wasn't finding the desired static_cast followed by
3
// const_cast interpretation.
4
 
5
struct Shape
6
{
7
  Shape() {}
8
  virtual ~Shape() {}
9
};
10
 
11
struct Loop
12
{
13
  Loop() {}
14
  virtual ~Loop() {}
15
  virtual void func() {}
16
};
17
 
18
struct Rect :
19
  public Shape,
20
  public Loop
21
{
22
  Rect() {}
23
  virtual ~Rect() {}
24
};
25
 
26
int main ()
27
{
28
  const Rect* rect = new Rect();
29
  Loop &l = ((Loop&)(*rect));
30
  return (&l != (const Loop *)rect);
31
}

powered by: WebSVN 2.1.0

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