From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14726 invoked by alias); 23 Jan 2007 23:21:32 -0000 Received: (qmail 14687 invoked by uid 48); 23 Jan 2007 23:21:21 -0000 Date: Tue, 23 Jan 2007 23:21:00 -0000 Subject: [Bug c++/30566] New: -Wshadow warns about clashes between nested function parameters in C++ X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "geoffk at gcc dot gnu dot org" 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: 2007-01/txt/msg02021.txt.bz2 The following program: void f( int x ) { class InnerClass { public: static void g( int x ) { // empty } }; } produces a warning: t.cc: In static member function 'static void f(int)::InnerClass::g(int)': t.cc:7: warning: declaration of 'int x' shadows a parameter t.cc:1: warning: shadowed declaration is here But it would be invalid for any function in InnerClass to try and use the outer "int x" (and in fact if you try it, you correctly get an error). -- Summary: -Wshadow warns about clashes between nested function parameters in C++ Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: diagnostic Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: geoffk at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30566