From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5894 invoked by alias); 5 Mar 2013 19:25:53 -0000 Received: (qmail 5799 invoked by uid 48); 5 Mar 2013 19:25:35 -0000 From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55357] -Wshadow warns about lambda function parameters matching variables in outer scope Date: Tue, 05 Mar 2013 19:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords Status Last reconfirmed CC AssignedTo Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-03/txt/msg00414.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55357 Jason Merrill 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 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.