This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55357] -Wshadow warns about lambda function parameters matching variables in outer scope
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 05 Mar 2013 19:25:34 +0000
- Subject: [Bug c++/55357] -Wshadow warns about lambda function parameters matching variables in outer scope
- Auto-submitted: auto-generated
- References: <bug-55357-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55357
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2013-03-05
CC| |jason at gcc dot gnu.org
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> 2013-03-05 19:25:34 UTC ---
(In reply to comment #0)
> I can't decide if this is correct behavior for the warning. It would catch
> errors caused by people thinking they were using the outer variables by simply
> disallowing overlap, which is good.
I think it's appropriate to warn here; whether or not there is a default
capture seems like a subtle distinction that is easy to miss when reading the
code.
> I also note that gcc warns me about the first line the lambda appears on (line
> 3) and the last line (line 5).
That's a bug.