Re: [C++ PATCH] PR c++/79133

2018-08-07 Thread Ville Voutilainen
On 7 August 2018 at 14:50, Jason Merrill wrote: > OK. Trunk only, no backports, presumably. I asked about backports in the second-to-last submission, but I am gravitating away from backporting this, it's a non-regression that's dealing with a fairly recent change, so I'm going to operate with a t

Re: [C++ PATCH] PR c++/79133

2018-08-07 Thread Jason Merrill
OK. On Tue, Aug 7, 2018 at 8:43 PM, Ville Voutilainen wrote: > On 7 August 2018 at 13:12, Jason Merrill wrote: >> Maybe put this block first rather than add !is_capture_proxy to the if >> condition? > > Thus?

Re: [C++ PATCH] PR c++/79133

2018-08-07 Thread Ville Voutilainen
On 7 August 2018 at 13:12, Jason Merrill wrote: > Maybe put this block first rather than add !is_capture_proxy to the if > condition? Thus? diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 3aafb0f..0faf739 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -2640,13 +264

Re: [C++ PATCH] PR c++/79133

2018-08-07 Thread Jason Merrill
On 08/07/2018 07:12 AM, Ville Voutilainen wrote: On 8 July 2018 at 02:08, Ville Voutilainen wrote: On 8 July 2018 at 01:54, Paolo Carlini wrote: That would make this more consistent with such a shadow warning, but I don't want to use the shadowing wording (which would be easy to do; just set

Re: [C++ PATCH] PR c++/79133

2018-08-06 Thread Ville Voutilainen
On 8 July 2018 at 02:08, Ville Voutilainen wrote: > On 8 July 2018 at 01:54, Paolo Carlini wrote: >>> That would make this more consistent with such a shadow warning, but I >>> don't want >>> to use the shadowing wording (which would be easy to do; just set >>> 'shadowed' and do >>> a 'goto infor

Re: [C++ PATCH] PR c++/79133

2018-07-07 Thread Ville Voutilainen
On 8 July 2018 at 01:54, Paolo Carlini wrote: >> That would make this more consistent with such a shadow warning, but I >> don't want >> to use the shadowing wording (which would be easy to do; just set >> 'shadowed' and do >> a 'goto inform'), because this isn't shadowing in the precise sense; >>

Re: [C++ PATCH] PR c++/79133

2018-07-07 Thread Paolo Carlini
Hi, On 08/07/2018 00:09, Ville Voutilainen wrote: On 8 July 2018 at 00:35, Paolo Carlini wrote: Hi, On 07/07/2018 23:20, Ville Voutilainen wrote: + error_at (DECL_SOURCE_LOCATION (old), + "capture %qD and lambda parameter %qD " + "have the sa

Re: [C++ PATCH] PR c++/79133

2018-07-07 Thread Ville Voutilainen
On 8 July 2018 at 00:35, Paolo Carlini wrote: > Hi, > > On 07/07/2018 23:20, Ville Voutilainen wrote: >> >> + error_at (DECL_SOURCE_LOCATION (old), >> + "capture %qD and lambda parameter %qD " >> + "have the same name", >> + dec

Re: [C++ PATCH] PR c++/79133

2018-07-07 Thread Paolo Carlini
Hi, On 07/07/2018 23:20, Ville Voutilainen wrote: + error_at (DECL_SOURCE_LOCATION (old), + "capture %qD and lambda parameter %qD " + "have the same name", + decl, old); Let's consider, say (with -Wshadow): int main() {   in

Re: [C++ PATCH] PR c++/79133

2018-07-07 Thread Ville Voutilainen
Needed one more tweak; when dealing with a capture proxy, always bail out and never fall through to the warning-handling code below the DR 2211 check. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 3aafb0f..fee5482 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -264

Re: [C++ PATCH] PR c++/79133

2018-07-07 Thread Ville Voutilainen
On 7 July 2018 at 21:55, Ville Voutilainen wrote: > On 7 July 2018 at 21:12, Paolo Carlini wrote: >> Should we really print the same name twice? Looks like we don't have >> available (yet) a location for cap - that would likely enable fancy things - >> but in that case too I don't think the user

Re: [C++ PATCH] PR c++/79133

2018-07-07 Thread Ville Voutilainen
On 7 July 2018 at 21:12, Paolo Carlini wrote: > Should we really print the same name twice? Looks like we don't have > available (yet) a location for cap - that would likely enable fancy things - > but in that case too I don't think the user would find that interesting > seeing the same name twice

Re: [C++ PATCH] PR c++/79133

2018-07-07 Thread Ville Voutilainen
On 7 July 2018 at 16:15, Jason Merrill wrote: > Did you consider handling this in check_local_shadow? Roughly like this, not fully tested yet: 2018-07-07 Ville Voutilainen gcc/cp/ PR c++/79133 * name-lookup.c (check_local_shadow): Reject captures and parameters with the same

Re: [C++ PATCH] PR c++/79133

2018-07-07 Thread Paolo Carlini
Hi, On 07/07/2018 01:50, Ville Voutilainen wrote: + error_at (DECL_SOURCE_LOCATION (parms), + "capture %qE and lambda parameter %qE " + "have the same name", + cap, parms); Should we really print the same name twice? Looks lik

Re: [C++ PATCH] PR c++/79133

2018-07-07 Thread Jason Merrill
Did you consider handling this in check_local_shadow? On Fri, Jul 6, 2018 at 7:50 PM, Ville Voutilainen wrote: > Tested on Linux-PPC64. Ok for trunk, perhaps with the change > that I move the test under cpp1y, since it's a c++14 test anyway? > > I considered pushing the captures into the paramete

[C++ PATCH] PR c++/79133

2018-07-06 Thread Ville Voutilainen
Tested on Linux-PPC64. Ok for trunk, perhaps with the change that I move the test under cpp1y, since it's a c++14 test anyway? I considered pushing the captures into the parameter scope. I don't know how to do that; changing the pushdecl_outermost_localscope to a pushdecl doesn't seem to cut it; I