[basic.scope.scope] Remove incorrect namespace redeclaration example - #9241
[basic.scope.scope] Remove incorrect namespace redeclaration example#9241yehudamber wants to merge 1 commit into
Conversation
Since the adoption of P2996 "Reflection for C++26", and the changes it made to [namespace.alias], namespace aliases are no longer alternative names for namespaces but entities of their own kind. Therefore, redeclaring a namespace as a namespace alias, even denoting the original namespace, violates [basic.link]/11.3, since one declaration declares the entity as a namespace and the other does not.
|
Ah, [basic.link]/8 says that two declarations declare the same entity if they correspond (and various other things not relevant here), which they do since they introduce the same name. But that reasoning would seem to apply equally to |
Good point. I thought [basic.scope.scope]/4.2 covers such cases, but I see now it does not apply when the other declaration declares a type alias. |
Since the adoption of P2996 "Reflection for C++26", and the changes it made to [namespace.alias], namespace aliases are no longer alternative names for namespaces but entities of their own kind. Therefore, redeclaring a namespace as a namespace alias, even denoting the original namespace, violates [basic.link]/11.3, since one declaration declares the entity as a namespace and the other does not.