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] - Rev 699

Compare with Previous | Blame | View Log

// { dg-do run  }
int fail;

class A *ptr_a;

class A {
public:
  char space1[24];
  virtual void foo() {
    if (this != ptr_a)
      fail = 1;
  }
};

class Space {
  char space2[36];
};

class B : public Space, public A {
} b;

void (B::*pmf1)() = &A::foo;
void (A::*pmf2)() = &A::foo;

int main() {
  ptr_a = &b;
  (b .* (void (B::*) ()) &A::foo) ();
  (b .* pmf1) ();
  (b .* pmf2) ();
  (b .* &A::foo) ();
  return fail;
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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