This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/86836] internal compiler error on structured bindings with shadow parameter on templated function
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 03 Aug 2018 08:57:15 +0000
- Subject: [Bug c++/86836] internal compiler error on structured bindings with shadow parameter on templated function
- Auto-submitted: auto-generated
- References: <bug-86836-4@http.gcc.gnu.org/bugzilla/>
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;
^~~~