From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24315 invoked by alias); 17 Feb 2002 10:06:05 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 24281 invoked by uid 71); 17 Feb 2002 10:06:01 -0000 Resent-Date: 17 Feb 2002 10:06:01 -0000 Resent-Message-ID: <20020217100601.24280.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, hiroki@air.ne.jp Received:(qmail 15581 invoked by uid 61); 17 Feb 2002 09:58:36 -0000 Message-Id:<20020217095836.15580.qmail@sources.redhat.com> Date: Sun, 17 Feb 2002 02:06:00 -0000 From: hiroki@air.ne.jp Reply-To: hiroki@air.ne.jp To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/5711: Questionable -Wshadow warning for function template's local variable X-SW-Source: 2002-02/txt/msg00384.txt.bz2 List-Id: >Number: 5711 >Category: c++ >Synopsis: Questionable -Wshadow warning for function template's local variable >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sun Feb 17 02:06:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Hiroki Horiuchi >Release: 3.0.3 >Organization: >Environment: CYGWIN_NT-5.0 1.3.3(0.46/3/2) 2001-09-12 23:54 i686 unknown >Description: file attached is warned as below when -Wshadow given. a.c: In function `T a(T) [with T = int]': a.c:27: instantiated from here a.c:4: warning: declaration of `x' shadows global declaration a.c: In function `T b() [with T = int]': a.c:27: instantiated from here a.c:12: warning: declaration of `x' shadows global declaration a.c: In function `T c() [with T = int]': a.c:27: instantiated from here a.c:20: warning: declaration of `x' shadows global declaration bash-2.05$ g++ -v Reading specs from /1/gcc-3.0.3/lib/gcc-lib/i686-pc-cygwin/3.0.3/specs Configured with: ./configure --prefix=/1/gcc-3.0.3 Thread model: single gcc version 3.0.3 >How-To-Repeat: g++ -fsyntax-only -Wshadow a.c >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="a.c" Content-Disposition: inline; filename="a.c" template T a(T x) { return x; } template T b() { T x = 0; return x; } template T c() { static T x = 0; return x; } int x() { return a(0) + b() + c(); }