c++: Fix ICE with lambda in member operator (PR93279)
authorJason Merrill <jason@redhat.com>
Fri, 24 Jan 2020 23:20:56 +0000 (18:20 -0500)
committerJason Merrill <jason@redhat.com>
Sat, 25 Jan 2020 03:18:46 +0000 (22:18 -0500)
commit8b91e848130e45b427599ad30e99f96e447ea9aa
tree851e36138628752ac727b597064877aeb0d5eabb
parentc671727004b87f0f256191c3a99c50dc4888e79b
c++: Fix ICE with lambda in member operator (PR93279)

Here the problem was that we were remembering the lookup in template scope,
and then trying to reuse that lookup in the instantiation without
substituting into it at all.  The simplest solution is to not try to
remember a lookup that finds a class-scope declaration, as in that case
doing the normal lookup again at instantiation time will always find the
right declarations.

PR c++/93279 - ICE with lambda in member operator.
* name-lookup.c (maybe_save_operator_binding): Don't remember
class-scope bindings.
gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template16.C [new file with mode: 0644]