2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wrange-loop-construct" }
17 bool operator!=(const It);
33 for (const double &x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
34 for (const double x : arr) { (void) x; }
35 for (const int &x : arr) { (void) x; }
36 for (double &&x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
37 for (double x : arr) { (void) x; }
39 for (const int &&x : cont_int) { (void) x; }
40 for (const int &x : cont_int) { (void) x; }
41 for (const int x : cont_int) { (void) x; }
42 for (int&& x : cont_int) { (void) x; }
43 for (int x : cont_int) { (void) x; }
45 for (const double &&x : cont_int) { (void) x; }
46 for (const double &x : cont_int) { (void) x; }
47 for (const double x : cont_int) { (void) x; }
49 for (double &&x : cont_int) { (void) x; }
50 for (double x : cont_int) { (void) x; }
52 for (const Bar &&x : cont_int) { (void) x; }
53 for (const Bar x : cont_int) { (void) x; }
59 Cont<int &> cont_int_ref;
61 for (const int &x : cont_int_ref) { (void) x; }
62 for (const int x : cont_int_ref) { (void) x; }
63 for (int &x : cont_int_ref) { (void) x; }
64 for (int x : cont_int_ref) { (void) x; }
66 for (const double &&x : cont_int_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
67 for (const double &x : cont_int_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
68 for (const double x : cont_int_ref) { (void) x; }
69 for (double &&x : cont_int_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
70 for (double x : cont_int_ref) { (void) x; }
72 for (const Bar &&x : cont_int_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
73 for (const Bar &x : cont_int_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
74 for (const Bar x : cont_int_ref) { (void) x; }
75 for (Bar &&x : cont_int_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
76 for (Bar x : cont_int_ref) { (void) x; }
84 for (const Bar &&x : cont_bar) { (void) x; }
85 for (const Bar &x : cont_bar) { (void) x; }
86 for (const Bar x : cont_bar) { (void) x; }
87 for (Bar &&x : cont_bar) { (void) x; }
88 for (Bar x : cont_bar) { (void) x; }
90 for (const int &&x : cont_bar) { (void) x; }
91 for (const int &x : cont_bar) { (void) x; }
92 for (const int x : cont_bar) { (void) x; }
93 for (int &&x : cont_bar) { (void) x; }
94 for (int x : cont_bar) { (void) x; }
100 Cont<Bar &> cont_bar_ref;
102 for (const Bar &x : cont_bar_ref) { (void) x; }
103 for (Bar &x : cont_bar_ref) { (void) x; }
104 for (Bar x : cont_bar_ref) { (void) x; }
106 for (const int &&x : cont_bar_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
107 for (const int &x : cont_bar_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
108 for (const int x : cont_bar_ref) { (void) x; }
109 for (int &&x : cont_bar_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
110 for (int x : cont_bar_ref) { (void) x; }
118 for (const Bar &&x : cont_foo) { (void) x; }
119 for (const Bar &x : cont_foo) { (void) x; }
120 for (const Bar x : cont_foo) { (void) x; }
121 for (Bar &&x : cont_foo) { (void) x; }
122 for (Bar x : cont_foo) { (void) x; }
128 Cont<Foo &> cont_foo_ref;
130 for (const Bar &&x : cont_foo_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
131 for (const Bar &x : cont_foo_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
132 for (const Bar x : cont_foo_ref) { (void) x; }
133 for (Bar &&x : cont_foo_ref) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
134 for (Bar x : cont_foo_ref) { (void) x; }
142 for (const double &x : arr) { (void) x; }
143 for (const double x : arr) { (void) x; }
144 for (double &x : arr) { (void) x; }
145 for (double x : arr) { (void) x; }
147 for (const int &&x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
148 for (const int &x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
149 for (const int x : arr) { (void) x; }
150 for (int &&x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
151 for (int x : arr) { (void) x; }
153 for (const Bar &&x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
154 for (const Bar &x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
155 for (const Bar x : arr) { (void) x; }
156 for (Bar &&x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
157 for (Bar x : arr) { (void) x; }
165 for (const Foo &x : arr) { (void) x; }
166 for (const Foo x : arr) { (void) x; }
167 for (Foo &x : arr) { (void) x; }
168 for (Foo x : arr) { (void) x; }
170 for (const Bar &&x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
171 for (const Bar &x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
172 for (const Bar x : arr) { (void) x; }
173 for (Bar &&x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
174 for (Bar x : arr) { (void) x; }
180 Bar arr[2] = { 1, 2 };
182 for (const Bar &x : arr) { (void) x; }
183 for (Bar &x : arr) { (void) x; }
184 for (Bar x : arr) { (void) x; }
186 for (const int &&x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
187 for (const int &x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
188 for (const int x : arr) { (void) x; }
189 for (int &&x : arr) { (void) x; } // { dg-warning "binds to a temporary constructed from type" }
190 for (int x : arr) { (void) x; }
199 for (const Bar &x : cont_bar) { (void) x; }
202 for (const T &x : cont_dep) { (void) x; }
204 template void fn10<Bar>();
210 for (const Bar &x : cont_bar) { (void) x; }