public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: hiroki@air.ne.jp To: gcc-gnats@gcc.gnu.org Subject: c++/5711: Questionable -Wshadow warning for function template's local variable Date: Sun, 17 Feb 2002 02:06:00 -0000 [thread overview] Message-ID: <20020217095836.15580.qmail@sources.redhat.com> (raw) >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<class T> T a(T x) { return x; } template<class T> T b() { T x = 0; return x; } template<class T> T c() { static T x = 0; return x; } int x() { return a(0) + b<int>() + c<int>(); }
next reply other threads:[~2002-02-17 10:06 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-02-17 2:06 hiroki [this message] 2002-02-17 5:24 neil
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020217095836.15580.qmail@sources.redhat.com \ --to=hiroki@air.ne.jp \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).