comparison gcc/testsuite/g++.dg/ipa/pr85421.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 // { dg-do compile }
2 // { dg-options "-O3 -std=gnu++1y -w" }
3
4 namespace {
5 template <typename b> b c(b);
6 template <typename d, typename, template <typename> class> struct f {
7 using g = d;
8 };
9 template <typename d, template <typename> class aa> using h = f<d, void, aa>;
10 template <typename d, template <typename> class aa>
11 using i = typename h<d, aa>::g;
12 template <typename b> struct j { typedef b k; };
13 } // namespace
14 namespace l {
15 template <typename b> class m {
16 public:
17 typedef b k;
18 };
19 } // namespace l
20 namespace a {
21 template <typename b> using n = l::m<b>;
22 template <typename b> class ac : public n<b> {};
23 struct s {
24 template <typename b> using ad = typename b::e;
25 };
26 template <typename o> struct p : s {
27 typedef typename o::k k;
28 using ag = i<k *, ad>;
29 };
30 } // namespace a
31 namespace l {
32 template <typename o> struct t : a::p<o> {};
33 } // namespace l
34 namespace a {
35 template <bool> struct al {
36 template <typename am> static void an(am ao, am) { c(*ao); }
37 };
38 template <typename am> void aq(am ao, am ap) {
39 typedef typename j<am>::k ar;
40 al<__has_trivial_destructor(ar)>::an(ao, ap);
41 }
42 namespace {
43 typedef char au;
44 }
45 } // namespace a
46 typedef char av;
47 typedef int aw;
48 typedef av ay;
49 typedef aw az;
50 namespace a {
51 template <typename, typename o> struct ba {
52 typedef typename l::t<o>::ag ag;
53 struct {
54 ag bb;
55 ag bc;
56 } bd;
57 };
58 template <typename b, typename o = ac<b>> class be : ba<b, o> {
59 typedef ba<b, o> bf;
60 typedef typename bf::ag ag;
61
62 public:
63 void bh() { bi(this->bd.bb); }
64 void bi(ag bj) { aq(bj, this->bd.bc); }
65 };
66 } // namespace a
67 namespace bk {
68 enum bl {};
69 enum bn { bo };
70 class q {
71 public:
72 static a::au bp(bn);
73 static bool bq(a::au *br, bn g) { return bs(br, g); }
74 static bl bs(a::au *br, bn g) {
75 if (br) {
76 auto bt = bp(g);
77 if (bt)
78 return bl();
79 }
80 }
81 };
82 template <typename, typename> class bu {};
83 } // namespace bk
84 namespace bv {
85 namespace bw {
86 class bx;
87 }
88 } // namespace bv
89 namespace bk {
90 enum by { bz };
91 struct ca;
92 class cb {
93 public:
94 class cc {
95 public:
96 virtual void cd(by) = 0;
97 };
98 virtual bu<ca, by> e();
99 cc *cf;
100 };
101 class cg {
102 public:
103 ~cg() { q::bq(ch, bo); }
104 a::au *ch;
105 };
106 class ci {
107 cg cj;
108 };
109 namespace ck {
110 enum cl : ay;
111 }
112 class r : ci {};
113 class cn {
114 public:
115 ck::cl co();
116 };
117 by cp(ck::cl);
118 class cq : cb, cb::cc {
119 bu<ca, by> ce(bv::bw::bx &, az) noexcept;
120 void cd(by);
121 void cr(bv::bw::bx &, az, cb::cc *) noexcept;
122 cn cs;
123 a::be<r> ct;
124 };
125 } // namespace bk
126 using bv::bw::bx;
127 namespace bk {
128 bu<ca, by> cq::ce(bx &, az) noexcept { ct.bh(); }
129 void cq::cr(bx &, az, cb::cc *) noexcept { cd(bz); }
130 void cq::cd(by) { cf->cd(cp(cs.co())); }
131 } // namespace bk