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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [net26.C] - Rev 154

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

// { dg-do run  }
// A test case found by InterViews testing...

extern "C" int printf(const char *, ...);

class A {
public:
        int foo() { printf("ok nv\n"); return 0; }
        virtual int vfoo() { printf("ok v\n"); return 0; }
};

struct S {
        int (A::*pfn1)();
        int (A::*pfn2)();
        int (A::*pfn3)();
};

// This failed before.
S s = { &A::foo, &A::vfoo, &A::foo };

A a;

int main() {
  (a.*s.pfn1)();
  (a.*s.pfn2)();
  printf("PASS\n");
  return 0;
}

Go to most recent revision | 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.