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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.martin/] [pmf1.C] - Blame information for rev 724

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

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// Based on a test case by Andrew Bell 
3
// Check for pointer-to-virtual-function calls on
4
// bases without virtual functions.
5
 
6
struct B{};
7
 
8
struct D: public B{
9
  virtual void foo();
10
};
11
 
12
void D::foo(){}
13
 
14
int main()
15
{
16
  B *b = new D;
17
  void (B::*f)() = static_cast(&D::foo);
18
  (b->*f)();
19
}

powered by: WebSVN 2.1.0

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