https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78286
Bug ID: 78286 Summary: typename, type members and non-type members: code should be rejected, but it is not Product: gcc Version: 6.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: michele.caini at gmail dot com Target Milestone: --- Consider the following code: struct S { struct foo {}; foo foo; }; int main() { typename S::foo t; (void) t; } GCC compiles the code with no errors, but it should be rejected. The non-type member foo hides the type member foo and the keyword typename cannot help to disambiguate. Moreover, in this case foo is not a dependent name and typename couldn't be used.