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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [overload/] [virtual1.C] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 jeremybenn
// Test that explicit scope suprresses virtual lookup even after an
2
// explicit object.
3
 
4
extern "C" int printf (const char *, ...);
5
 
6
struct A
7
{
8
  virtual int f () { return 0; }
9
};
10
 
11
struct B: public A
12
{
13
  int f () { return 1; }
14
  int g() { return this->A::f(); }
15
};
16
 
17
int main()
18
{
19
  B b;
20
  return b.g();
21
}

powered by: WebSVN 2.1.0

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