https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66879
--- Comment #7 from Anders Granlund <anders.granlund.0 at gmail dot com> --- (In reply to Jonathan Wakely from comment #4) > So confirming as accepts-invalid with this testcase: > > class A; > > namespace Y { > using ::A; > class A { }; > } Here are two similar test cases pulled in from my related bug reports (i have marked them as resolved duplicates). The following ill-formed programs are also accepted by gcc: namespace R { struct f; } namespace S { using R::f; } struct S::f {}; int main() {} The above is ill-formed by [dcl.meaning]p1 ( http://eel.is/c++draft/dcl.meaning#1 ) namespace P { struct S; } namespace R { using namespace P; } struct R::S {}; int main() {} The above is also ill-formed by [dcl.meaning]p1 In general redeclarations must be done directly and not indirectly.