cplusplus / cplusplus/draft

using-declaration is not a member vs [class.member.lookup]

Open
#4,731 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

The lookup set for N in C, called S(N,C), consists of two component sets: the declaration set, a set of members named N; and the subobject set, a set of subobjects where declarations of these members were found (possibly via using-declarations).

Although the using-declaration declares a synonymous name for the declarations nominated by it, however, the using-declaration does not declare a member, hence the synonymous name is not the name of a member(i.e, a using-declaration that is found is not a declaration of a member).

A member-declaration does not declare new members of the class if it is

  • a using-declaration ([namespace.udecl]), or

For any other member-declaration, each declared entity that is not an unnamed bit-field is a member of the class, and each such member-declaration shall either declare at least one member name of the class or declare at least one unnamed bit-field.

struct A{
    int a;
};
struct B{
    char a;
};
struct C:A,B{
    using A::a;
};
C c;
c.a = 0;

Is the set of subobjects of S(a,C) {C} or{A}? There are some contradictions here.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the [class.member.lookup] wording and the cited rules for using-declarations and member-declarations. Compare those passages with the A, B, and C example in the issue. Done means the apparent contradiction is resolved by a clear interpretation or the relevant standard wording is clarified.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, tex
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.