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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [overload/] [virtual1.C] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
// Test that explicit scope suprresses virtual lookup even after an
// Test that explicit scope suprresses virtual lookup even after an
// explicit object.
// explicit object.
extern "C" int printf (const char *, ...);
extern "C" int printf (const char *, ...);
struct A
struct A
{
{
  virtual int f () { return 0; }
  virtual int f () { return 0; }
};
};
struct B: public A
struct B: public A
{
{
  int f () { return 1; }
  int f () { return 1; }
  int g() { return this->A::f(); }
  int g() { return this->A::f(); }
};
};
int main()
int main()
{
{
  B b;
  B b;
  return b.g();
  return b.g();
}
}
 
 

powered by: WebSVN 2.1.0

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