https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97582

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>:

https://gcc.gnu.org/g:cb168f779c87c1e0c37d22ea82dfb93ff8c873bc

commit r11-7191-gcb168f779c87c1e0c37d22ea82dfb93ff8c873bc
Author: Patrick Palka <ppa...@redhat.com>
Date:   Thu Feb 11 10:59:54 2021 -0500

    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.

Reply via email to