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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [inherit/] [covariant1.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// PR c++/5607
2
 
3
// { dg-do run }
4
 
5
class A {
6
public:
7
  virtual A* getThis() { return this; }
8
};
9
 
10
class B {
11
int a;
12
public:
13
  virtual B* getThis() { return this; }
14
};
15
 
16
class AB : public A, public B {
17
public:
18
  virtual AB* getThis() { return this; }
19
};
20
 
21
int main ()
22
{
23
  AB* ab = new AB();
24
 
25
  A* a = ab;
26
  B* b = ab;
27
 
28
  if (a->getThis() != a
29
      || b->getThis() != b)
30
    return 1;
31
 
32
  return 0;
33
}

powered by: WebSVN 2.1.0

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