public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39763] New: -Wshadow reports shadowed declarations for parameters of unnamed temp objects
@ 2009-04-14 13:06 caolanm at redhat dot com
2009-04-14 13:06 ` [Bug c++/39763] " caolanm at redhat dot com
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: caolanm at redhat dot com @ 2009-04-14 13:06 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 772 bytes --]
This is very similar to Bug 39526 except that the test-case there now (Fedora
rawhide: gcc-4.4.0-0.32.x86_64) passes, while this similar one reports...
g++ -c -Wshadow demo.cxx
demo.cxx: In function int foo():
demo.cxx:11: warning: declaration of infoo shadows a previous local
demo.cxx:10: warning: shadowed declaration is here
--
Summary: -Wshadow reports shadowed declarations for parameters
of unnamed temp objects
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: caolanm at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/39763] -Wshadow reports shadowed declarations for parameters of unnamed temp objects
2009-04-14 13:06 [Bug c++/39763] New: -Wshadow reports shadowed declarations for parameters of unnamed temp objects caolanm at redhat dot com
@ 2009-04-14 13:06 ` caolanm at redhat dot com
2009-04-14 14:26 ` jason at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: caolanm at redhat dot com @ 2009-04-14 13:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from caolanm at redhat dot com 2009-04-14 13:06 -------
Created an attachment (id=17631)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17631&action=view)
trivial demo
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/39763] -Wshadow reports shadowed declarations for parameters of unnamed temp objects
2009-04-14 13:06 [Bug c++/39763] New: -Wshadow reports shadowed declarations for parameters of unnamed temp objects caolanm at redhat dot com
2009-04-14 13:06 ` [Bug c++/39763] " caolanm at redhat dot com
@ 2009-04-14 14:26 ` jason at gcc dot gnu dot org
2009-04-14 14:57 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-04-14 14:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jason at gcc dot gnu dot org 2009-04-14 14:25 -------
I can't reproduce this with 4.4 or 4.5.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/39763] -Wshadow reports shadowed declarations for parameters of unnamed temp objects
2009-04-14 13:06 [Bug c++/39763] New: -Wshadow reports shadowed declarations for parameters of unnamed temp objects caolanm at redhat dot com
2009-04-14 13:06 ` [Bug c++/39763] " caolanm at redhat dot com
2009-04-14 14:26 ` jason at gcc dot gnu dot org
@ 2009-04-14 14:57 ` jakub at gcc dot gnu dot org
2009-04-14 15:04 ` jason at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-04-14 14:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jakub at gcc dot gnu dot org 2009-04-14 14:57 -------
I certainly can, with e.g. fresly updated:
GNU C++ (GCC) version 4.5.0 20090414 (experimental) (x86_64-unknown-linux-gnu)
LC_ALL=C ./cc1plus -O2 -Wshadow z.C -quiet
z.C: In function 'int foo()':
z.C:11: warning: declaration of 'infoo' shadows a previous local
z.C:10: warning: shadowed declaration is here
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/39763] -Wshadow reports shadowed declarations for parameters of unnamed temp objects
2009-04-14 13:06 [Bug c++/39763] New: -Wshadow reports shadowed declarations for parameters of unnamed temp objects caolanm at redhat dot com
` (2 preceding siblings ...)
2009-04-14 14:57 ` jakub at gcc dot gnu dot org
@ 2009-04-14 15:04 ` jason at gcc dot gnu dot org
2009-04-14 17:04 ` jason at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-04-14 15:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jason at gcc dot gnu dot org 2009-04-14 15:04 -------
Yeah, it would help to use -Wshadow...
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jason at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-04-14 15:04:04
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/39763] -Wshadow reports shadowed declarations for parameters of unnamed temp objects
2009-04-14 13:06 [Bug c++/39763] New: -Wshadow reports shadowed declarations for parameters of unnamed temp objects caolanm at redhat dot com
` (3 preceding siblings ...)
2009-04-14 15:04 ` jason at gcc dot gnu dot org
@ 2009-04-14 17:04 ` jason at gcc dot gnu dot org
2009-04-14 17:15 ` jason at gcc dot gnu dot org
2009-04-14 18:54 ` jason at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-04-14 17:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jason at gcc dot gnu dot org 2009-04-14 17:04 -------
Subject: Bug 39763
Author: jason
Date: Tue Apr 14 17:04:04 2009
New Revision: 146053
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146053
Log:
PR c++/39763
* name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
about shadowing by tentative parms.
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/name-lookup.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/warn/Wshadow-4.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/39763] -Wshadow reports shadowed declarations for parameters of unnamed temp objects
2009-04-14 13:06 [Bug c++/39763] New: -Wshadow reports shadowed declarations for parameters of unnamed temp objects caolanm at redhat dot com
` (4 preceding siblings ...)
2009-04-14 17:04 ` jason at gcc dot gnu dot org
@ 2009-04-14 17:15 ` jason at gcc dot gnu dot org
2009-04-14 18:54 ` jason at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-04-14 17:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jason at gcc dot gnu dot org 2009-04-14 17:14 -------
Subject: Bug 39763
Author: jason
Date: Tue Apr 14 17:14:04 2009
New Revision: 146054
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146054
Log:
PR c++/39763
* name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
about shadowing by tentative parms.
Modified:
branches/gcc-4_4-branch/gcc/cp/ChangeLog
branches/gcc-4_4-branch/gcc/cp/name-lookup.c
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/warn/Wshadow-4.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/39763] -Wshadow reports shadowed declarations for parameters of unnamed temp objects
2009-04-14 13:06 [Bug c++/39763] New: -Wshadow reports shadowed declarations for parameters of unnamed temp objects caolanm at redhat dot com
` (5 preceding siblings ...)
2009-04-14 17:15 ` jason at gcc dot gnu dot org
@ 2009-04-14 18:54 ` jason at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-04-14 18:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jason at gcc dot gnu dot org 2009-04-14 18:54 -------
Fixed.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39763
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-04-14 18:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-14 13:06 [Bug c++/39763] New: -Wshadow reports shadowed declarations for parameters of unnamed temp objects caolanm at redhat dot com
2009-04-14 13:06 ` [Bug c++/39763] " caolanm at redhat dot com
2009-04-14 14:26 ` jason at gcc dot gnu dot org
2009-04-14 14:57 ` jakub at gcc dot gnu dot org
2009-04-14 15:04 ` jason at gcc dot gnu dot org
2009-04-14 17:04 ` jason at gcc dot gnu dot org
2009-04-14 17:15 ` jason at gcc dot gnu dot org
2009-04-14 18:54 ` jason at gcc dot gnu dot org
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).