]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Fix ICE with lambda in operator function [PR93597]
authorMarek Polacek <polacek@redhat.com>
Mon, 6 Apr 2020 00:31:56 +0000 (20:31 -0400)
committerMarek Polacek <polacek@redhat.com>
Mon, 6 Apr 2020 00:35:26 +0000 (20:35 -0400)
commit6db837a5288ee3ca5ec504fbd5a765817e556ac2
tree174510f947ae30c58789db0dc7d0cdc4d00be396
parente76564a81fede5c4b799b3d28ce27630695f0b8a
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.
gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-93597.C [new file with mode: 0644]