Debian Codegraph @

gcc/testsuite/g++.dg/opt/pr94468.C

raw
1 // PR rtl-optimization/94468
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-O2" }
4 // { dg-additional-options "-fPIC" { target fpic } }
5
6 bool a();
7 enum b {};
8 class c;
9 template <typename> struct d;
10 template <class e, typename g, typename... h> struct d<g (e::*)(h...)> {
11 typedef e i;
12 };
13 struct j { j(void(int, j *, c *, void **, bool *)) {} };
14 template <typename l> struct m : public j {
15 l ab;
16 static void ac(int, j *, c *, void **, bool *);
17 m(l f) : j(ac), ab(f) {}
18 };
19 b ad;
20 struct c {
21 template <typename n, typename o>
22 void ae(typename d<n>::i *p, n af, typename d<o>::i *ag, o ah) {
23 ai(p, &af, ag, &ah, new m<o>(ah), ad, &d<n>::i::aj);
24 }
25 void ai(c *, void *, c *, void *, j *, b, int *);
26 };
27 struct r : public c { static int aj; void t(); };
28 struct al : public c {
29 static int aj;
30 void am();
31 void ao();
32 void ap();
33 };
34 struct aq { aq(const int &, const int & = int()); };
35 struct ar : public c { ~ar(); };
36 struct as : public ar {
37 as();
38 void at();
39 void au();
40 void av();
41 };
42 struct u : public c { void ax(); };
43 struct ay { int az(); };
44 struct ba : public c { static int aj; void bb(); };
45 struct bc : public al { bc() { if (a()) am(); } };
46 as::as() {
47 al *bd = new bc;
48 ae(bd, &al::ao, this, &as::au);
49 ae(bd, &al::ap, this, &as::av);
50 r be;
51 u bf;
52 ae(&be, &r::t, &bf, &u::ax);
53 c bg = *bd;
54 ae(static_cast<ba *>(&bg), &ba::bb, this, &as::at);
55 ay bh;
56 aq am(bh.az());
57 }