You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CWG3033 [basic.scope.namespace] Scope fragment of inline namespaces in redeclarations after the declarator-id but before determination of correspondence #698
For each non-friend redeclaration or specialization whose target scope is or is contained by the scope, the portion after the declarator-id, class-head-name, or enum-head-name is also included in the scope.
It is unclear how, for the purposes of https://eel.is/c++draft/dcl.type.elab#3, a compiler is supposed to know that the nearest enclosing namespace (and, thus, the target scope for struct X) is N::B at the point the specialization of Q is required.
Indeed, no implementation uses N::B as the target scope for the elaborated type specifier.
Clang reasonably uses N and the other implementations questionably use the global namespace: https://godbolt.org/z/drfo4rz9E
Suggested resolution:
Perhaps the scope that starts after the declarator-id should be the one named by the nested-name-specifier until after the declarator.