cplusplus / cplusplus/draft

[class] "class lattice" is never clearly defined

Open
#5,391 1 comment 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

[class.mi] p4 says

A base class specifier that does not contain the keyword virtual specifies a non-virtual base class. A base class specifier that contains the keyword virtual specifies a virtual base class. For each distinct occurrence of a non-virtual base class in the class lattice of the most derived class, the most derived object ([intro.object]) shall contain a corresponding distinct base class subobject of that type. For each distinct base class that is specified virtual, the most derived object shall contain a single base class subobject of that type.

we phrase this rule with the help of class lattice, which means, that what number of non-virtual or virtual base class objects the most derived class object can contain depends on what the class lattice of the most derived class is. We lack a formal definition for how a class lattice of a class form. It could arguably say all rules that depend on the class lattice are all unclear. More details about claiming the definition of class lattice are in https://stackoverflow.com/questions/16886788/c11-class-lattice-with-mixed-virtual-and-non-virtual-bases, this issue has existed since the c++11 standard.

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 [class.mi] paragraph 4 and the referenced Stack Overflow discussion. Determine how the C++ standard should formally define the class lattice and identify which rules depend on that definition. Done means the draft contains an unambiguous definition that resolves the stated virtual and non-virtual base-class cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
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.