[basic.lookup.qual.general] p2 Improve the definition of a member-qualified name
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
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
struct C{
int member;
};
struct D:C{};
struct E:D{};
struct F:E{};
int main(){
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 opt unqualified-id , that is, member is the unqualified-id in 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]).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the [basic.lookup.qual.general] definition and the F::D::C::member example at #1. Check the proposed wording against the distinction between an unqualified-id that is the id-expression and a nested-name-specifier in that expression; done means the definition is unambiguous about which components are member-qualified names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100