From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36185 invoked by alias); 31 Mar 2015 13:15:43 -0000 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 Received: (qmail 36119 invoked by uid 48); 31 Mar 2015 13:15:38 -0000 From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56100] spurious -Wshadow warning with local variable in template class Date: Tue, 31 Mar 2015 13:29: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-Version: 4.7.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg03522.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56100 --- Comment #4 from Jason Merrill --- (In reply to Paolo Carlini from comment #3) > I wonder if in such cases would it simply make sense to suppress the warning > basing on the locations I think we want to suppress the warning on instantiation even if the order is reversed: given int foo; template struct bar { void qux () { baz (); } private: void baz () { int foo; } }; int main () { bar ().qux (); } We first warn about the declaration in the template, and then again about the instantiation.