111
|
1 // PR tree-optimize/42337
|
|
2 // { dg-do compile }
|
|
3 // { dg-options "-O2" }
|
131
|
4 // { dg-additional-options "-Wno-return-type" }
|
111
|
5
|
|
6 template<class _T1, class _T2> struct pair {
|
|
7 _T2 second;
|
|
8 };
|
|
9 template<typename _Tp>
|
|
10 inline const _Tp& max(const _Tp& __a, const _Tp& __b) { }
|
|
11
|
|
12 template<typename _ForwardIterator, typename _Tp, typename _Compare> _ForwardIterator
|
|
13 lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp) { }
|
|
14 template<class _CharT> struct char_traits {};
|
|
15
|
|
16 template<typename _Iterator, typename _Container> class __normal_iterator {
|
|
17 public: typedef _Iterator iterator_type;
|
|
18 __normal_iterator& operator++() {
|
|
19 }
|
|
20 };
|
|
21 template<typename _IteratorL, typename _IteratorR, typename _Container>
|
|
22 inline bool operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) { }
|
|
23 template<typename _Tp> class new_allocator {
|
|
24 public:
|
|
25 typedef _Tp* pointer;
|
|
26 typedef const _Tp* const_pointer;
|
|
27 };
|
|
28
|
|
29 template<typename _Tp>
|
|
30 class allocator: public new_allocator<_Tp> {
|
|
31 public:
|
|
32 template<typename _Tp1> struct rebind {
|
|
33 typedef allocator<_Tp1> other;
|
|
34 };
|
|
35 };
|
|
36
|
|
37 template<typename _Arg, typename _Result> struct unary_function { };
|
|
38 template<typename _Arg1, typename _Arg2, typename _Result> struct binary_function { };
|
|
39 template<typename _Tp> struct less : public binary_function<_Tp, _Tp, bool> { };
|
|
40 template<typename _Pair> struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> { };
|
|
41 template<typename _Tp> struct _Rb_tree_iterator {
|
|
42 typedef _Tp* pointer;
|
|
43 pointer operator->() const {
|
|
44 }
|
|
45 };
|
|
46 template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc = allocator<_Val> >
|
|
47 class _Rb_tree {
|
|
48 typedef _Val value_type;
|
|
49 public: typedef _Rb_tree_iterator<value_type> iterator;
|
|
50 };
|
|
51 template <typename _Key, typename _Tp, typename _Compare = less<_Key>, typename _Alloc = allocator<pair<const _Key, _Tp> > >
|
|
52 class map {
|
|
53 public: typedef _Key key_type;
|
|
54 typedef pair<const _Key, _Tp> value_type;
|
|
55 typedef _Compare key_compare;
|
|
56 private: typedef typename _Alloc::template rebind<value_type>::other _Pair_alloc_type;
|
|
57 typedef _Rb_tree<key_type, value_type, _Select1st<value_type>, key_compare, _Pair_alloc_type> _Rep_type;
|
|
58 public: typedef typename _Pair_alloc_type::pointer pointer;
|
|
59 typedef typename _Rep_type::iterator iterator;
|
|
60 iterator find(const key_type& __x) { }
|
|
61 };
|
|
62
|
|
63 template<typename _Tp, typename _Alloc> struct _Vector_base {
|
|
64 typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
|
|
65 };
|
|
66 template<typename _Tp, typename _Alloc = allocator<_Tp> >
|
|
67 class vector : protected _Vector_base<_Tp, _Alloc> {
|
|
68 typedef _Vector_base<_Tp, _Alloc> _Base;
|
|
69 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
|
|
70 public:
|
|
71 typedef typename _Tp_alloc_type::pointer pointer;
|
|
72 typedef typename _Tp_alloc_type::const_pointer const_pointer;
|
|
73 typedef __normal_iterator<pointer, vector> iterator;
|
|
74 typedef __normal_iterator<const_pointer, vector> const_iterator;
|
|
75 iterator begin() { }
|
|
76 const_iterator begin() const { }
|
|
77 const_iterator end() const { }
|
|
78 unsigned long size() const { }
|
|
79 };
|
|
80
|
|
81 class SSC {
|
|
82 public:
|
|
83 SSC () {}
|
|
84 SSC (const int& cs);
|
|
85 };
|
|
86 extern int flag;
|
|
87
|
|
88 struct TP {
|
|
89 const int cl_;
|
|
90 const vector<int> &its_;
|
|
91 int max_s_;
|
|
92 };
|
|
93
|
|
94 double foo(TP *p);
|
|
95 map<int, int> cs_;
|
|
96
|
|
97 template <typename T> class vector32 {
|
|
98 public:
|
|
99 typedef T& reference;
|
|
100 typedef T* iterator;
|
|
101 typedef const T* const_iterator;
|
|
102 iterator begin() { return data_; }
|
|
103 iterator end() { return data_ + size_; }
|
|
104 long unsigned int size() const { return size_; }
|
|
105 T* data_;
|
|
106 unsigned size_;
|
|
107 };
|
|
108
|
|
109 struct SF : public pair<unsigned long long, double> { };
|
|
110
|
|
111 template<typename KEY, typename VALUE> class SFVT {
|
|
112 private: typedef vector32<SF> Container;
|
|
113 typedef typename Container::const_iterator CI;
|
|
114 mutable Container v_;
|
|
115 mutable bool sorted_;
|
|
116 struct Cmp : public binary_function<SF, SF, bool> {
|
|
117 };
|
|
118 __attribute__((always_inline)) VALUE IS(const SFVT &sfv) const {
|
|
119 if (sfv.v_.size() < v_.size()) {
|
|
120 return sfv.IS(*this);
|
|
121 }
|
|
122 else {
|
|
123 VALUE sum = 0.0;
|
|
124 CI beg = sfv.v_.begin();
|
|
125 CI end = sfv.v_.end();
|
|
126 for (CI i = v_.begin();
|
|
127 i != v_.end();
|
|
128 ++i) { beg = lower_bound(beg, end, *i, Cmp()); if (beg == end) { return sum; } }
|
|
129 }
|
|
130 }
|
|
131 public: explicit SFVT(const int capacity = 0) : sorted_(true) { }
|
|
132 long unsigned int size() const { }
|
|
133 __attribute__((always_inline)) VALUE DP(const SFVT &sfv) const {
|
|
134 return IS(sfv);
|
|
135 }
|
|
136 };
|
|
137 class SFV : public SFVT<unsigned long long, double> { };
|
|
138
|
|
139 class Edge;
|
|
140 extern int flag2;
|
|
141
|
|
142 double foo(TP *p) {
|
|
143 int nbests_requested = max(p->max_s_, flag);
|
|
144 map<int, int>::iterator it = cs_.find(p->cl_);
|
|
145 int* c = &it->second;
|
|
146 for (vector<int>::const_iterator iter = p->its_.begin();
|
|
147 iter != p->its_.end();
|
|
148 ++iter) {
|
|
149 }
|
|
150 vector<int*> fb;
|
|
151 vector<double> w;
|
|
152 int *hg = 0;
|
|
153 if (flag2 == 10) {
|
|
154 hg = &flag2;
|
|
155 }
|
|
156 int nr = 0;
|
|
157 for (vector<int*>::iterator iter = fb.begin();
|
|
158 (iter != fb.end() && nr < nbests_requested);
|
|
159 ++iter) {
|
|
160 }
|
|
161 if (hg) {
|
|
162 SFV s_weights;
|
|
163 for (int i = 0;
|
|
164 i < w.size();
|
|
165 ++i) {
|
|
166 }
|
|
167 SFV uw;
|
|
168 for (int i = 0, j = 0;
|
|
169 i < uw.size() && j < s_weights.size();
|
|
170 ) {
|
|
171 }
|
|
172 const double tc = uw.DP(s_weights);
|
|
173 }
|
|
174 }
|