Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[class] "class lattice" is never clearly defined #5391

Open
xmh0511 opened this issue Apr 13, 2022 · 1 comment
Open

[class] "class lattice" is never clearly defined #5391

xmh0511 opened this issue Apr 13, 2022 · 1 comment

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Apr 13, 2022

[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.

@frederick-vs-ja
Copy link
Contributor

A prehistoric working draft in 1993 had already been using "class lattice" without defining it.

It seems possible to port "inheritance graph" from Itanium C++ ABI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants