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 mergemap(map<T> orig,map<T> toadd)16template <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 main()22main() { 23 map<double> x, y; 24 mergemap(x, y); 25 } 26