Debian Codegraph @

gcc/testsuite/g++.dg/expr/pmf-4.C

raw
1 // PR c++/118509
2 // { dg-do run }
3 // { dg-options "-Wall -O2" }
4
5 struct A { void foo () { a = 1; } int a; A () : a (0) {} };
6 struct B : virtual A {};
7 typedef void (A::*C) ();
8
9 __attribute__((noipa)) void
10 foo (C x, B *y)
11 {
12 (y->*x) ();
13 }
14
15 int
16 main ()
17 {
18 B b;
19 foo (&A::foo, &b);
20 if (b.a != 1)
21 __builtin_abort ();
22 }