https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86836
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Without templates: struct A { int operator*(); void operator++(); bool operator!=(A); }; class map { public: A begin(); A end(); }; void mergemap(map orig, map toadd) { for (auto p : toadd) auto [orig] = orig; } int main() { map x, y; mergemap(x, y); } this is rejected with: pr86836-2.C: In function ‘void mergemap(map, map)’: pr86836-2.C:14:19: error: use of ‘orig’ before deduction of ‘auto’ auto [orig] = orig; ^~~~