diff options
author | Patrick Palka <ppalka@redhat.com> | 2021-02-11 10:59:54 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2021-02-11 10:59:54 -0500 |
commit | cb168f779c87c1e0c37d22ea82dfb93ff8c873bc (patch) | |
tree | 16f4421193ce9ad7b934fa31438a98757cd4d93f /gcc/opts.c | |
parent | 38c5703449c0638618ba6896f0d039c3868ad4e0 (diff) | |
download | gcc-cb168f779c87c1e0c37d22ea82dfb93ff8c873bc.zip gcc-cb168f779c87c1e0c37d22ea82dfb93ff8c873bc.tar.gz gcc-cb168f779c87c1e0c37d22ea82dfb93ff8c873bc.tar.bz2 |
c++: Fix ICE from op_unqualified_lookup [PR97582]
In this testcase, we're crashing because the lookup of operator+ from
within the generic lambda via lookup_name finds multiple bindings
(C1::operator+ and C2::operator+) and returns a TREE_LIST thereof,
something which op_unqualified_lookup (and push_operator_bindings) isn't
prepared to handle.
This patch extends op_unqualified_lookup and push_operator_bindings
to handle such an ambiguous lookup result in the natural way.
gcc/cp/ChangeLog:
PR c++/97582
* name-lookup.c (op_unqualified_lookup): Handle an ambiguous
lookup result by discarding it if the first element is a
class-scope declaration, otherwise return it.
(push_operator_bindings): Handle an ambiguous lookup result by
doing push_local_binding on each element in the list.
gcc/testsuite/ChangeLog:
PR c++/97582
* g++.dg/cpp0x/lambda/lambda-template17.C: New test.
Diffstat (limited to 'gcc/opts.c')
0 files changed, 0 insertions, 0 deletions