Debian Codegraph @

gcc/testsuite/g++.dg/ext/pr85503.C

raw
1 // PR target/85503
2 // { dg-do compile { target { { powerpc64le-*-* } && c++11 } } }
3 // { dg-options "-O2 -mvsx" }
4 // { dg-require-effective-target powerpc_vsx }
5
6 namespace b {
7 template < int c > struct d { static constexpr int e = c; };
8 typedef d< false > f;
9 template < typename g > struct h { typedef g i; };
10 template < typename > class j;
11 template < bool, bool, typename... > struct aa;
12 struct k {
13 template < typename n, typename... q >
14 static h< decltype(n()(q()...)) > o(int);
15 };
16 template < typename p, typename... t > struct aa< false, false, p, t... > : k {
17 typedef decltype(o< p, t... >(0)) i;
18 };
19 template < typename p, typename... t >
20 struct ab : aa< f::e, f::e, p, t... >::i {};
21 template < typename p, typename... t > struct j< p(t...) > : ab< p, t... > {};
22 } enum { r, s };
23 typedef long x;
24 template < typename > struct ac;
25 template < typename y > struct ac< y & > { typedef y i; };
26 template < typename y > struct j { typedef typename b::j< y >::i i; };
27 template < typename > struct ad;
28 template < typename > struct ae;
29 template < typename > class af;
30 template < typename, int ag, int ah, int = 0, int = ag, int = ah > class ai;
31 template < typename > class aj;
32 template < typename, typename, typename > class ak;
33 template < typename > class al;
34 template < typename > struct am;
35 template < typename > struct an;
36 template < typename y > struct ao { typedef typename am< y >::i i; };
37 struct aq {
38 typedef const ai< double, 2, 1 > &ar;
39 };
40 template < typename as > struct at { typedef aj< as > i; };
41 template < typename as > struct au { typedef typename at< as >::i i; };
42 template < typename av > av aw(const typename an< av >::i *);
43 template < typename av, int > av az(const typename an< av >::i *ba) {
44 return aw< av >(ba);
45 }
46 typedef __attribute__((altivec(vector__))) double bb;
47 template <> struct am< double > { typedef bb i; };
48 template <> struct an< bb > { typedef double i; };
49 template <> bb aw(const double *ba) { return __builtin_vec_vsx_ld(0, ba); }
50 struct bc {
51 template < typename av > int bd(av a) { bd(a); __builtin_unreachable (); }
52 };
53 struct be {
54 double operator()(const int, const int);
55 };
56 template < typename as > class bf : public ae< as > {
57 public:
58 typedef typename ad< as >::bg bg;
59 using ae< as >::bh;
60 enum { bi };
61 bg bj() const;
62 template < typename bk > bg bl(const bk &) const;
63 };
64 template < typename as > class aj : public bf< as > {
65 public:
66 using bf< as >::bh;
67 template < typename bm > ak< be, const as, const bm > operator-(bm bn) {
68 return ak< be, const as, const bm >(bh(), bn);
69 }
70 int bo() const;
71 al< as > array() { return bh(); }
72 };
73 template < typename as > struct ae {
74 const as &bh() const { return *static_cast< const as * >(this); }
75 };
76 template < typename > struct bp;
77 template < typename > struct bq;
78 template < typename y > struct br : bq< y > {
79 br(y bs) : bq< y >(bs) {}
80 };
81 template < typename y > struct br< const y > : br< y > {
82 br(const y &bs) : br< y >(bs) {}
83 };
84 template < typename as > struct br< af< as > > {
85 typedef as bt;
86 br(const bt &m) : bu(m.bv()) {}
87 template < int bw, typename ay > ay bx(x, x by) {
88 return az< ay, bw >(bu + by);
89 }
90 const typename bt::bg *bu;
91 };
92 template < typename bg, int u, int bz, int ca, int cb, int cc >
93 struct br< ai< bg, u, bz, ca, cb, cc > > : br< af< ai< bg, u, bz > > > {
94 typedef ai< bg, u, bz > cd;
95 br(const cd &m) : br< af< cd > >(m) {}
96 };
97 template < typename bk, typename ce, typename cf >
98 struct br< ak< bk, ce, cf > > : bp< ak< bk, ce, cf > > {
99 br(ak< bk, ce, cf > bs) : bp< ak< bk, ce, cf > >(bs) {}
100 };
101 template < typename bk, typename ce, typename cf >
102 struct bp< ak< bk, ce, cf > > {
103 bp(ak< bk, ce, cf > bs) : cg(), ch(bs.ci()) {}
104 template < int bw, typename ay > ay bx(x cj, x by) {
105 return ch.template bx< bw, ay >(cj, by);
106 }
107 ce cg;
108 br< cf > ch;
109 };
110 template < typename cd > struct v {
111 typedef typename ac< typename cd::ck >::i cl;
112 v(cl &arg) : cn(arg) {}
113 template < int bw, typename ay > ay bx(x cj, x by) {
114 return cn.template bx< bw, ay >(cj, by);
115 }
116 br< cl > cn;
117 };
118 template < typename cm > struct bq< al< cm > > : v< al< cm > > {
119 bq(al< cm > w) : v< al< cm > >(w.dd()) {}
120 };
121 template < typename as > class ap : public bf< as > {};
122 template < int ax > struct co { double array[ax]; };
123 template < int ax > class cq {
124 co< ax > bu;
125
126 public:
127 const double *bv() const { return bu.array; }
128 };
129 template < typename as > class af : public at< as >::i {
130 public:
131 typedef typename at< as >::i cp;
132 cq< cp::bi > cs;
133 const typename ad< as >::bg *bv() const { return cs.bv(); }
134 };
135 template < typename cr, int ag, int ah, int cu, int ct, int cw >
136 struct ad< ai< cr, ag, ah, cu, ct, cw > > {
137 typedef cr bg;
138 };
139 template < typename, int ag, int ah, int, int, int >
140 class ai : public af< ai< double, ag, ah > > {
141 public:
142 typedef ai cv;
143 };
144 template < typename bk, typename ce, typename cf >
145 struct ad< ak< bk, ce, cf > > {
146 typedef typename j< bk(typename ce::bg, typename cf::bg) >::i bg;
147 };
148 template < typename, typename, typename > class z;
149 template < typename bk, typename cy, typename cx >
150 class ak : public z< bk, cy, cx > {
151 public:
152 typedef cx RhsNested;
153 ak(cy, cx cz) : da(), db(cz) {}
154 RhsNested ci() { return db; }
155 cy da;
156 RhsNested db;
157 };
158 template < typename bk, typename ce, typename cf >
159 class z : public au< ak< bk, ce, cf > >::i {};
160 template < typename as > int aj< as >::bo() const { (*this).bj(); __builtin_unreachable (); }
161 template < typename as > struct dc {
162 typedef typename ao< typename as::bg >::i ay;
163 enum { d, de };
164 enum { df = de };
165 };
166 template < typename as > struct dk {
167 enum { dh, di, dj, alignment };
168 typedef typename dc< as >::ay PacketScalar;
169 static PacketScalar dl(as dm, bc) {
170 return dm.template dn< alignment, PacketScalar >(di, dj);
171 }
172 };
173 template < typename, typename as, int = dc< as >::df > struct redux_impl;
174 template < typename Func, typename as > struct redux_impl< Func, as, s > {
175 static int dl(as dm, Func func) { func.bd(dk< as >::dl(dm, func)); __builtin_unreachable (); }
176 };
177 template < typename _XprType > class redux_evaluator {
178 public:
179 typedef _XprType cd;
180 redux_evaluator(cd bs) : m_evaluator(bs), m_xpr(bs) {}
181 typedef typename cd::bg bg;
182 template < int bw, typename ay > ay dn(x di, x dj) {
183 return m_evaluator.template bx< bw, ay >(dj, di);
184 }
185 br< cd > m_evaluator;
186 cd m_xpr;
187 };
188 template < typename as >
189 template < typename Func >
190 typename ad< as >::bg bf< as >::bl(const Func &func) const {
191 typedef redux_evaluator< as > ThisEvaluator;
192 ThisEvaluator thisEval(bh());
193 redux_impl< Func, ThisEvaluator >::dl(thisEval, func);
194 __builtin_unreachable ();
195 }
196 template < typename as > typename ad< as >::bg bf< as >::bj() const {
197 bl(bc());
198 __builtin_unreachable ();
199 }
200 template < typename ExpressionType >
201 struct ad< al< ExpressionType > > : ad< typename ExpressionType::cv > {};
202 template < typename > class al : public ap< al< ai< double, 2, 1 > > > {
203 public:
204 typedef aq::ar ck;
205 al(const ai< double, 2, 1 > &dg) : m_expression(dg) {}
206 const ai< double, 2, 1 > &dd() { return m_expression; }
207 ck m_expression;
208 };
209 typedef ai< double, 2, 1 > Vector2d;
210 class OnHoverHandlerGraphicsItem {
211 public:
212 static Vector2d corners;
213 };
214 int
215 GasGraphicsItemcreateOnHoverHandler() {
216 Vector2d l;
217 (l - OnHoverHandlerGraphicsItem::corners.array()).bo();
218 __builtin_unreachable ();
219 }