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
In the current draft, the definition of a member-qualified name is that
A member-qualified name is the (unique) component name ([expr.prim.id.unqual]), if any, of
an unqualified-id or
a nested-name-specifier of the form type-name :: or namespace-name ::
in the id-expression of a class member access expression ([expr.ref]).
Here, "in" can be interpreted by its English meaning, which can result in an issue arisen from this example
structC{
int member;
};
structD:C{};
structE:D{};
structF:E{};
intmain(){
E e;
e.F::D::C::member = 0; // #1
}
the id-expression of the class member access expression at #1 is F::D::C::member obeying the grammar nested-name-specifier template optunqualified-id , that is, member is the unqualified-idin this id-expression of the class member access expression. Does it mean member is a member-qualified name? It seems this is not the intent of that rule. Conversely, F can be a member-qualified name since the nested-name-specifier to which it belongs obeys the form type-name :: and is in the id-expression.
My opinion is that the above rule may be improved to be that
A member-qualified name is the (unique) component name ([expr.prim.id.unqual]), if any, of
an unqualified-id that is the id-expression or
a nested-name-specifier of the form type-name :: or namespace-name :: in the id-expression
of a class member access expression ([expr.ref]).
The text was updated successfully, but these errors were encountered:
In the current draft, the definition of a member-qualified name is that
Here, "in" can be interpreted by its English meaning, which can result in an issue arisen from this example
the id-expression of the class member access expression at
#1
isF::D::C::member
obeying the grammar nested-name-specifier template opt unqualified-id , that is,member
is the unqualified-id in this id-expression of the class member access expression. Does it meanmember
is a member-qualified name? It seems this is not the intent of that rule. Conversely,F
can be a member-qualified name since the nested-name-specifier to which it belongs obeys the form type-name :: and is in the id-expression.My opinion is that the above rule may be improved to be that
The text was updated successfully, but these errors were encountered: