Re: [PATCH] c++: Fix ICE from op_unqualified_lookup [PR97582]

2021-02-10 Thread Jason Merrill via Gcc-patches
I think it is true for functions. But if the result is ambiguous, you can look at the first element to see if it's from class scope. I see, that's good to know. So something like this? -- >8 -- Subject: [PATCH] c++: Fix ICE from op_unqualified_lookup [PR97582] In this testcase, we'r

Re: [PATCH] c++: Fix ICE from op_unqualified_lookup [PR97582]

2021-02-10 Thread Patrick Palka via Gcc-patches
outer scope. > > > > > > > > D'oh, good point. But IIUC, even if we did return (and later inject at > > > > instantiation time) namespace-scope declarations that were hidden by > > > > class-scope declarations, wouldn't the lookup at inst

Re: [PATCH] c++: Fix ICE from op_unqualified_lookup [PR97582]

2021-02-10 Thread Jason Merrill via Gcc-patches
o see if it's from class scope. I see, that's good to know. So something like this? -- >8 -- Subject: [PATCH] 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

Re: [PATCH] c++: Fix ICE from op_unqualified_lookup [PR97582]

2021-02-10 Thread Patrick Palka via Gcc-patches
; > to me that the end result might be the same, but I'm not sure. > > The injection happens in the function parameter binding level, so I'd expect > it to be found before class bindings. Oops, I didn't look at push_operator_bindings closely enough. Never mind about that id

Re: [PATCH] c++: Fix ICE from op_unqualified_lookup [PR97582]

2021-02-10 Thread Jason Merrill via Gcc-patches
On 2/9/21 5:12 PM, Patrick Palka wrote: On Tue, 2 Feb 2021, Jason Merrill wrote: On 2/2/21 12:19 AM, Patrick Palka wrote: In this testcase, we're crashing because the lookup of operator+ from within the generic lambda via lookup_name finds multiple bindings (namely C1::operator+ and C2::operat

Re: [PATCH] c++: Fix ICE from op_unqualified_lookup [PR97582]

2021-02-09 Thread Patrick Palka via Gcc-patches
On Tue, 2 Feb 2021, Jason Merrill wrote: > On 2/2/21 12:19 AM, Patrick Palka wrote: > > In this testcase, we're crashing because the lookup of operator+ from > > within the generic lambda via lookup_name finds multiple bindings > > (namely C1::operator+ and C2::operator+) and returns a TREE_LIST >

Re: [PATCH] c++: Fix ICE from op_unqualified_lookup [PR97582]

2021-02-01 Thread Jason Merrill via Gcc-patches
On 2/2/21 12:19 AM, Patrick Palka wrote: In this testcase, we're crashing because the lookup of operator+ from within the generic lambda via lookup_name finds multiple bindings (namely C1::operator+ and C2::operator+) and returns a TREE_LIST thereof, something which maybe_save_operator_binding is

[PATCH] c++: Fix ICE from op_unqualified_lookup [PR97582]

2021-02-01 Thread Patrick Palka via Gcc-patches
In this testcase, we're crashing because the lookup of operator+ from within the generic lambda via lookup_name finds multiple bindings (namely C1::operator+ and C2::operator+) and returns a TREE_LIST thereof, something which maybe_save_operator_binding isn't prepared to handle. Since we already d