Debian Codegraph @

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

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target c++11 } */
3 /* { dg-additional-options "-O3" } */
4 /* { dg-additional-options "-march=z13" { target s390x-*-* } } */
5
6 template <int a> struct k { static constexpr int c = a; };
7 template <bool, bool, typename...> struct o;
8 template <typename f, typename... g> struct o<false, false, f, g...> {
9 typedef decltype(0) h;
10 };
11 template <typename... g> struct p : o<k<false>::c, k<false>::c, g...> {};
12 class q;
13 class r {
14 public:
15 void ap(q);
16 };
17 template <typename, typename aw> void ax(aw ay) { ay(); }
18 template <typename az> void ba(az bb) {
19 using bc = p<az>;
20 using bd = typename bc::h;
21 ax<bd>(bb);
22 }
23 template <unsigned> class s;
24 class t {
25 public:
26 s<8> br();
27 template <typename...> void operator()() { ba(br()); }
28 };
29 class q {
30 public:
31 template <typename az> q(az) { H(); }
32 struct H {
33 t cc;
34 H() { cc(); }
35 };
36 };
37 template <unsigned long> struct I {};
38 template <unsigned long cl, typename j> void cm(j cn, I<cl>) {
39 cm(cn, I<cl - 1>());
40 cn(cl);
41 }
42 template <typename j> void cm(j, I<0>) {}
43 template <unsigned co> struct u {
44 long cp[co];
45 void cq(const u &);
46 void cs(int);
47 void operator<(u);
48 };
49 template <unsigned co> void u<co>::cq(const u &l) {
50 cm([&](int i) { cp[i] &= l.cp[i]; }, I<co>());
51 }
52 template <unsigned co> void u<co>::cs(int m) {
53 cm([&](int i) { cp[i] >>= m; }, I<co - 2>());
54 }
55 template <unsigned> class K;
56 template <unsigned co> class v {
57 int cv;
58 friend K<co>;
59
60 public:
61 void cx(int, unsigned char *, unsigned long long);
62 };
63 template <unsigned co> class K {
64 public:
65 static void cx(v<co> &);
66 };
67 template <unsigned co>
68 void v<co>::cx(int, unsigned char *, unsigned long long) {
69 K<co>::cx(*this);
70 }
71 template <unsigned co> void K<co>::cx(v<co> &cz) {
72 u<co> a, b, d;
73 int e, n = cz.cv;
74 for (; e;)
75 if (cz.cv)
76 a.cs(cz.cv);
77 a.cq(d);
78 a < b;
79 }
80 template <unsigned co> class s {
81 v<co> *dh;
82
83 public:
84 void operator()();
85 };
86 template <unsigned co> void s<co>::operator()() {
87 int f;
88 unsigned char g;
89 long h;
90 dh->cx(f, &g, h);
91 }
92 void d() {
93 r i;
94 t j;
95 i.ap(j);
96 }