https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93597
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:6db837a5288ee3ca5ec504fbd5a765817e556ac2 commit r9-8456-g6db837a5288ee3ca5ec504fbd5a765817e556ac2 Author: Marek Polacek <pola...@redhat.com> Date: Sun Apr 5 20:31:56 2020 -0400 c++: Fix ICE with lambda in operator function [PR93597] If we are going to use get_first_fn let's make sure we operate on is_overloaded_fn, as the rest of the codebase does, and if lookup finds any class-scope declaration, return early too. PR c++/93597 - ICE with lambda in operator function. * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn. * g++.dg/cpp0x/lambda/lambda-93597.C: New test.