https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67074
--- Comment #1 from Anders Granlund <anders.granlund.0 at gmail dot com> --- I have reported the same bug in clang also: https://llvm.org/bugs/show_bug.cgi?id=24324 Richard Smith confirmed it and added this additional test case: And likewise: namespace N {} namespace N = N; If a namespace alias really just binds a name to an existing namespace, the above should be valid, because all declarations of name N in the TU refer to the same entity.