Did you consider handling this in check_local_shadow?

On Fri, Jul 6, 2018 at 7:50 PM, Ville Voutilainen
<ville.voutilai...@gmail.com> 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 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 guess that I should add
> a new function into name-lookup.[ch], but I wonder whether
> that makes sense, considering that this is lambda-only functionality.
> I also wonder whether it makes more sense than the solution
> in this patch, considering that we handle packs here as well
> and capturepack/parampack, capturepack/param, capture/parampack
> and capture/param clashes.
>
> Guidance welcome. This approach has the benefit that it, well,
> seems to work. :)
>
> 2018-07-07  Ville Voutilainen  <ville.voutilai...@gmail.com>
>
>     gcc/cp/
>
>     PR c++/79133
>     * lambda.c (start_lambda_function): Reject captures and parameters
>     with the same name.
>
>     testsuite/
>
>     PR c++/79133
>     * g++.dg/cpp0x/lambda/lambda-shadow3.C: New.

Reply via email to