Bug 92954 - -Wshadow does not report when a struct member shadows a global
Summary: -Wshadow does not report when a struct member shadows a global
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks: Wshadow
  Show dependency treegraph
 
Reported: 2019-12-16 11:31 UTC by Andrew Pinski
Modified: 2024-07-27 20:07 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-12-21 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2019-12-16 11:31:16 UTC
Take:
int t;
struct g{
int t;
void h(void)
{
t++;
}
};
---- CUT ---
I would have thought there would be a warning with -Wshadow but there is not.
Comment 1 Eric Gallager 2019-12-21 05:59:35 UTC
Confirmed.