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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [pmf8.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
int fail;
3
 
4
class A *ptr_a;
5
 
6
class A {
7
public:
8
  char space1[24];
9
  virtual void foo() {
10
    if (this != ptr_a)
11
      fail = 1;
12
  }
13
};
14
 
15
class Space {
16
  char space2[36];
17
};
18
 
19
class B : public Space, public A {
20
} b;
21
 
22
void (B::*pmf1)() = &A::foo;
23
void (A::*pmf2)() = &A::foo;
24
 
25
int main() {
26
  ptr_a = &b;
27
  (b .* (void (B::*) ()) &A::foo) ();
28
  (b .* pmf1) ();
29
  (b .* pmf2) ();
30
  (b .* &A::foo) ();
31
  return fail;
32
}

powered by: WebSVN 2.1.0

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