[Bug c++/91746] New: Bogus error due to a type and variable with the same name
david.bolvansky at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Sep 11 22:34:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91746
Bug ID: 91746
Summary: Bogus error due to a type and variable with the same
name
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
GCC fails to compile:
struct pixel {
int x;
int y;
};
struct master {
pixel pixel;
};
<source>:9:11: error: declaration of 'pixel master::pixel' changes meaning of
'pixel' [-fpermissive]
9 | pixel pixel;
| ^~~~~
<source>:3:8: note: 'pixel' declared here as 'struct pixel'
3 | struct pixel {
| ^
Clang, ICC, MSVC - compiles it just fine.
More information about the Gcc-bugs
mailing list