http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53154
Bug #: 53154 Summary: Template class not shadowed by member declaration Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: amona...@gcc.gnu.org The following code is unexpectedly accepted without any warning: template<int> struct foo {static const int bar=1;}; struct baz {static const int foo=foo<0>::bar;}; When foo is not template, GCC diagnoses the shadowing as expected: struct foo {static const int bar=1;}; struct baz {static const int foo=foo::bar;}; <stdin>:2:39: error: declaration of ‘const int baz::foo’ [-fpermissive] <stdin>:1:8: error: changes meaning of ‘foo’ from ‘struct foo’ [-fpermissive] 4.5, 4.6, 4.7 and trunk behave the same.