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/] [net38.C] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do run  }
2
struct A {
3
  virtual int a ()       { return 0; }
4
};
5
 
6
struct B {
7
  virtual int b ()       { return 0; }
8
  virtual int b2 ()      { return 0; }
9
};
10
 
11
struct C : public A, public B {
12
  virtual int a ()       { return 1; }
13
  virtual int b ()       { return 2; }
14
  virtual int b2 ()      { return 3; }
15
};
16
 
17
int (C::*vmpb) () = &C::b;
18
int (C::*vmpb2) () = &C::b2;
19
int (C::*vmpa) () = &C::a;
20
 
21
int main () {
22
  C c;
23
  if ((c.*vmpa)() != 1)
24
    return 1;
25
  if ((c.*vmpb)() != 2)
26
    return 1;
27
  if ((c.*vmpb2)() != 3)
28
    return 1;
29
}

powered by: WebSVN 2.1.0

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