This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/86836] internal compiler error on structured bindings with shadow parameter on templated function


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;
                   ^~~~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]