summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr68220.C
blob: 8775e4dbaf89c846d352b4e0b42d422c98b783ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
// { dg-do compile }
// { dg-additional-options "-std=gnu++11" }
namespace mpl {
template <typename, typename = int> struct lambda;
template <typename T3> struct if_ { typedef T3 type; };
template <int> struct arg {
  template <typename U1, typename> struct apply { typedef U1 type; };
};
template <typename> struct begin_impl;
template <typename Sequence> struct begin {
  typedef typename Sequence::tag tag_;
  typedef typename begin_impl<tag_>::template apply<Sequence>::type type;
};
template <typename> struct O1_size_impl;
}
template <long N> struct long_ { static const long value = N; };
namespace mpl {
template <typename Sequence>
struct O1_size
    : O1_size_impl<typename Sequence::tag>::template apply<Sequence> {};
typedef arg<1> _1;
template <typename T> struct protect : T {};
template <typename F> struct apply_wrap1 : F::template apply<int> {};
template <typename F, typename T1, typename T2>
struct apply_wrap2 : F::template apply<T1, T2> {};
template <typename F> struct apply_wrap5 : F::template apply<int> {};
template <typename, typename, typename, typename, typename, typename>
struct resolve_bind_arg;
template <typename T, typename> struct replace_unnamed_arg { typedef T type; };
template <typename F, typename> struct bind1 {
  template <typename> struct apply {
    typedef typename apply_wrap1<F>::type type;
  };
};
template <typename F, typename T1, typename U1, typename U2, typename U3,
          typename U4, typename U5>
struct resolve_bind_arg<bind1<F, T1>, U1, U2, U3, U4, U5> {
  typedef typename apply_wrap5<bind1<F, T1>>::type type;
};
template <typename F, typename, typename T2> struct bind2 {
  template <typename U1, typename U2> struct apply {
    typedef resolve_bind_arg<typename replace_unnamed_arg<T2, arg<1>>::type, U1,
                             U2, int, int, int> t2;
    typedef typename apply_wrap2<F, typename U1::type, typename t2::type>::type
        type;
  };
};
template <typename T> struct quote_impl { typedef T type; };
template <template <typename> class F> struct quote1 {
  template <typename> struct apply : quote_impl<F<int>> {};
};
template <typename T, typename> struct lambda {
  typedef T type;
  typedef arg<1> result_;
};
template <typename, template <typename> class, typename> struct le_result1;
template <template <typename> class F, typename L1>
struct le_result1<int, F, L1> {
  typedef protect<bind1<quote1<F>, typename L1::result_>> type;
};
template <template <typename> class F, typename T1, typename Tag>
struct lambda<F<T1>, Tag> {
  typedef typename le_result1<int, F, lambda<T1>>::type type;
};
template <int, typename, typename, typename> struct iter_fold_impl;
template <typename First, typename State, typename ForwardOp>
struct iter_fold_impl<1, First, State, ForwardOp> {
  typedef typename apply_wrap2<ForwardOp, State, First>::type state;
};
template <typename Sequence, typename State, typename ForwardOp>
struct iter_fold {
  typedef typename iter_fold_impl<O1_size<Sequence>::value,
                                  typename begin<Sequence>::type, State,
                                  ForwardOp>::state type;
};
template <typename> struct deref;
template <typename> struct push_front_impl;
template <typename T> struct l_item {
  typedef int tag;
  typedef l_item type;
  typedef long_<1> size;
  typedef T item;
};
struct l_end {
  typedef int tag;
  typedef l_end type;
};
template <> struct push_front_impl<int> {
  template <typename, typename T> struct apply { typedef l_item<T> type; };
};
template <> struct O1_size_impl<int> {
  template <typename> struct apply : l_item<int>::size {};
};
template <typename> struct l_iter;
template <typename Node> struct deref<l_iter<Node>> {
  typedef typename Node::item type;
};
template <> struct begin_impl<int> {
  template <typename List> struct apply {
    typedef l_iter<typename List::type> type;
  };
};
template <typename> struct list : l_item<int> {};
}
template <typename T> T &cast_storage(void *storage) {
  return *static_cast<T *>(storage);
}
struct symbol;
struct visitation_impl_step {
  typedef symbol type;
};
template <typename Visitor, typename VoidPtrCV, typename T>
void visitation_impl_invoke_impl(int, Visitor visitor, VoidPtrCV storage, T *) {
  visitor.internal_visit(cast_storage<T>(storage), 1);
}
int visitation_impl_invoke_internal_which, visitation_impl_logical_which;
template <typename Visitor, typename VoidPtrCV, typename T,
          typename NoBackupFlag>
void visitation_impl_invoke(Visitor visitor, VoidPtrCV storage, T t,
                            NoBackupFlag, int) {
  visitation_impl_invoke_impl(visitation_impl_invoke_internal_which, visitor,
                              storage, t);
}
template <typename Which, typename step0, typename Visitor, typename VoidPtrCV,
          typename NoBackupFlag>
void visitation_impl(int, Visitor visitor, VoidPtrCV storage, int,
                     NoBackupFlag no_backup_flag, Which, step0 *) {
  switch (visitation_impl_logical_which)
  case 0:
  visitation_impl_invoke(visitor, storage,
                         static_cast<typename step0::type *>(0), no_backup_flag,
                         1);
}
template <long N> struct size_t { static const long value = N; };
struct aligned_storage_imp {};
template <long> class aligned_storage : aligned_storage_imp {
public:
  void *address() { return static_cast<aligned_storage_imp *>(this); }
};
namespace mpl {
template <typename> struct less;
template <typename> struct select_max {
  template <typename OldIterator, typename> struct apply {
    typedef OldIterator type;
  };
};
template <typename Sequence, typename Predicate = less<arg<11>>>
struct max_element : iter_fold<Sequence, typename begin<Sequence>::type,
                               protect<select_max<Predicate>>> {};
template <typename Sequence = int, typename T = int>
struct push_front
    : push_front_impl<typename Sequence::tag>::template apply<Sequence, T> {};
template <> struct push_front<> {
  template <typename T1, typename T2> struct apply : push_front<T1, T2> {};
};
template <typename> struct sizeof_ : size_t<sizeof(int)> {};
template <long, typename, typename, typename, typename>
struct reverse_fold_impl;
template <typename First, typename State, typename BackwardOp,
          typename ForwardOp>
struct reverse_fold_impl<1, First, State, BackwardOp, ForwardOp> {
  typedef First iter0;
  typedef typename apply_wrap2<
      BackwardOp,
      typename apply_wrap2<ForwardOp, State, typename deref<iter0>::type>::type,
      typename deref<iter0>::type>::type state;
};
template <typename Sequence, typename State, typename BackwardOp,
          typename ForwardOp = arg<1>>
struct reverse_fold {
  typedef typename reverse_fold_impl<O1_size<Sequence>::value,
                                     typename begin<Sequence>::type, State,
                                     BackwardOp, ForwardOp>::state type;
};
template <typename> struct inserter {
  typedef mpl::l_end state;
  typedef mpl::push_front<> operation;
};
template <typename Seq, typename Op, typename In>
struct reverse_transform1_impl
    : reverse_fold<Seq, typename In::state,
                   bind2<typename lambda<typename In::operation>::type, _1,
                         bind1<typename lambda<Op>::type, arg<2>>>> {};
template <typename P1, typename P2>
struct transform1
    : if_<reverse_transform1_impl<P1, P2, inserter<push_front<>>>>::type {};
}
template <typename, typename> struct max_value {
  typedef mpl::transform1<mpl::list<symbol>, mpl::sizeof_<mpl::arg<1>>>::type
      transformed_;
  typedef mpl::max_element<transformed_>::type max_it;
  typedef mpl::deref<max_it>::type type;
};
template <typename> struct make_storage {
  typedef max_value<int, mpl::sizeof_<int>>::type max_size;
  typedef aligned_storage<max_size::value> type;
};
struct destroyer {
  template <typename T> void internal_visit(T &operand, int) { operand.~T(); }
};
template <typename, typename...> class variant {
  typedef int internal_types;
  int which_;
  make_storage<internal_types>::type storage_;
public:
  ~variant() {
    destroyer visitor;
    internal_apply_visitor(visitor);
  }
  template <typename Visitor, typename VoidPtrCV>
  void internal_apply_visitor_impl(int internal_which, int, Visitor visitor,
                                   VoidPtrCV storage) {
    visitation_impl(internal_which, visitor, storage, int(), int(),
                    static_cast<int>(0),
                    static_cast<visitation_impl_step *>(0));
  }
  int internal_apply_visitor___trans_tmp_1;
  template <typename Visitor> void internal_apply_visitor(Visitor visitor) {
    internal_apply_visitor_impl(which_, internal_apply_visitor___trans_tmp_1,
                                visitor, storage_.address());
  }
};
struct symbol {
  virtual ~symbol();
};
using Identifier = variant<int>;
struct Fragment {
  virtual void foo() const = 0;
  virtual ~Fragment();
};
struct ProcFrag : Fragment {
  ~ProcFrag() {}
  void foo() const;
  Identifier id;
};
struct Fragments {
  ~Fragments() { delete x; }
  Fragment *x;
} fragments;