[Bug c++/68374] G++ -Wshadow doesn't warn about static member shadowing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68374 Paolo Carlini changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot gnu.org Target Milestone|--- |9.0 --- Comment #8 from Paolo Carlini --- Fully fixed in trunk.
[Bug c++/68374] G++ -Wshadow doesn't warn about static member shadowing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68374 --- Comment #7 from paolo at gcc dot gnu.org --- Author: paolo Date: Wed May 2 18:15:56 2018 New Revision: 259853 URL: https://gcc.gnu.org/viewcvs?rev=259853=gcc=rev Log: /cp 2018-05-02 Paolo CarliniJason Merrill PR c++/68374 * name-lookup.c (check_local_shadow): Don't handle static old declarations in the block handling locals shadowing locals. /testsuite 2018-05-02 Paolo Carlini Jason Merrill PR c++/68374 * g++.dg/warn/Wshadow-13.C: New. * g++.dg/warn/Wshadow-14.C: Likewise. Added: trunk/gcc/testsuite/g++.dg/warn/Wshadow-13.C trunk/gcc/testsuite/g++.dg/warn/Wshadow-14.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/name-lookup.c trunk/gcc/testsuite/ChangeLog
[Bug c++/68374] G++ -Wshadow doesn't warn about static member shadowing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68374 Paolo Carlini changed: What|Removed |Added Status|REOPENED|ASSIGNED CC|paolo.carlini at oracle dot com| Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com --- Comment #6 from Paolo Carlini --- Mine.
[Bug c++/68374] G++ -Wshadow doesn't warn about static member shadowing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68374 Paolo Carlini changed: What|Removed |Added Status|RESOLVED|REOPENED CC||paolo.carlini at oracle dot com Resolution|FIXED |--- --- Comment #5 from Paolo Carlini --- Somebody closed this by mistake.
[Bug c++/68374] G++ -Wshadow doesn't warn about static member shadowing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68374 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org --- Comment #4 from Eric Gallager --- (In reply to xyzdr4gon333 from comment #3) > (In reply to Paolo Carlini from comment #1) > > This is already fixed in trunk. I'm adding a testcase and closing the bug. > > What do you mean with trunk? [...snip..] > > Ah okay this version does work: > > g++-8 (Debian 8-20180207-2) 8.0.1 20180207 (experimental) [trunk > revision 257435] That's trunk.
[Bug c++/68374] G++ -Wshadow doesn't warn about static member shadowing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68374 xyzdragon at fastmail dot fm changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #3 from xyzdragon at fastmail dot fm --- (In reply to Paolo Carlini from comment #1) > This is already fixed in trunk. I'm adding a testcase and closing the bug. What do you mean with trunk? It still doesn't warn for g++-4.9 (Debian 4.9.4-2) 4.9.4` g++-5 (Debian 5.4.1-4) 5.4.1 20161202` g++-5 (Debian 5.5.0-8) 5.5.0 20171010` g++-6 (Debian 6.3.0-18) 6.3.0 20170516` g++-6 (Debian 6.4.0-12) 6.4.0 20180123` g++-7 (Debian 7.2.0-16) 7.2.0` g++-7 (Debian 7.3.0-3) 7.3.0` Ah okay this version does work: g++-8 (Debian 8-20180207-2) 8.0.1 20180207 (experimental) [trunk revision 257435] although I don't see why this can't be a minor version bugfix in the older major versions: shadowtest.cpp: In member function ‘int f::g(int)’: shadowtest.cpp:3:24: warning: declaration of ‘mVar’ shadows a previous local [-Wshadow] int g(int x) { int mVar=3; return x+mVar; } ^~~~ shadowtest.cpp:2:16: note: shadowed declaration is here static int mVar; ^~~~ Btw offtopic, aren't all these major version upgrades too much too fast? I've lost quite a bit of time, because my system didn't work with g++5 (kernel module didn't compile), or because CUDA didn't, or because I had ABI-incompatibility bugs, because I linked code compiled with different compiler compilers accidentally and the list goes on ...
[Bug c++/68374] G++ -Wshadow doesn't warn about static member shadowing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68374 Paolo Carlini changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2017-06-02 Ever confirmed|0 |1 --- Comment #2 from Paolo Carlini --- Uhm, the diagnostic is suboptimal however: talks about a local instead of a static member. Looking into it.
[Bug c++/68374] G++ -Wshadow doesn't warn about static member shadowing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68374 Paolo Carlini changed: What|Removed |Added CC|xyzdragon at fastmail dot fm | --- Comment #1 from Paolo Carlini --- This is already fixed in trunk. I'm adding a testcase and closing the bug.