OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [p3139.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// prms-id: 3139
3
 
4
extern "C" int printf(const char *, ...);
5
 
6
class A {
7
  public:
8
  A() { }
9
  virtual int a() = 0;
10
};
11
 
12
class B : virtual public A {
13
  public:
14
  virtual int a() = 0;
15
};
16
 
17
class C : public B {
18
  public:
19
  int a() { return 42; }
20
};
21
 
22
int main() {
23
  B * b = new C;
24
  printf("%d.\n", b->a());
25
  return 0;
26
}

powered by: WebSVN 2.1.0

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