| 1 |
// PR c++/86836 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-options "" } |
| 4 |
|
| 5 |
struct A { |
| 6 |
int operator*(); |
| 7 |
void operator++(); |
| 8 |
bool operator!=(A); |
| 9 |
}; |
| 10 |
template <typename> class map { |
| 11 |
public: |
| 12 |
A begin(); |
| 13 |
A end(); |
| 14 |
}; |
| 15 |
|
| 16 |
template <typename T> void mergemap(map<T> orig, map<T> toadd) { |
| 17 |
for (auto p : toadd) |
| 18 |
auto [orig] = orig; // { dg-error "use of 'orig' before deduction of 'auto'" } |
| 19 |
} // { dg-warning "structured bindings only available with" "" { target c++14_down } .-1 } |
| 20 |
|
| 21 |
int |
| 22 |
main() { |
| 23 |
map<double> x, y; |
| 24 |
mergemap(x, y); |
| 25 |
} |