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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// Bug: g++ doesn't compensate for finding a virtual function in a
3
// non-primary vtable when generating PMFs.
4
// Submitted by Jason Merrill 
5
 
6
struct A {
7
  virtual ~A() {}
8
};
9
 
10
struct B {
11
  virtual void f () = 0;
12
};
13
 
14
struct C : public A, public B {
15
  void f ();
16
};
17
 
18
void (C::* B_f)() = &B::f;   // this works
19
void (C::* C_f)() = &C::f;   // this breaks
20
 
21
C* p;
22
 
23
void C::f ()
24
{
25
  p = this;
26
}
27
 
28
int main()
29
{
30
  C c;
31
 
32
  (c.*B_f)();
33
  if (p != &c)
34
    return 1;
35
 
36
  (c.*C_f)();
37
  if (p != &c)
38
    return 1;
39
}

powered by: WebSVN 2.1.0

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