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.member.lookup] Clarify "unambiguous base class" #5173

Open
xmh0511 opened this issue Dec 27, 2021 · 2 comments · May be fixed by #7306
Open

[class.member.lookup] Clarify "unambiguous base class" #5173

xmh0511 opened this issue Dec 27, 2021 · 2 comments · May be fixed by #7306

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Dec 27, 2021

We refer to "unambiguous base class" in this document many times but we never clearly define the concept in this document. I think we can define this concept with the help of [class.member.lookup] p5.3.

[class.member.lookup] p5.3 says

Otherwise, the new S(N, C) is a lookup set with the shared set of declarations and the union of the subobject sets.

We can say

A non-dependent class type B is an unambiguous base class of class C, if and only if C is derived from B and the declaration set and the subobject set of S(B, C) consist of a unique declaration of B and a unique member subobject, respectively.

@frederick-vs-ja
Copy link
Contributor

It seems buggy to me to say "non-dependent" here, which would indicate that a dependent base class is ambiguous.

@frederick-vs-ja
Copy link
Contributor

Maybe we can add something to [class.derived.general]/3:

If class B is a base class of class D, B is an unambiguous base class of D if there is only one (possibly recursive) base class subobject of type B of an object of type D, otherwise, B is an ambiguous base class of D.

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

Successfully merging a pull request may close this issue.

2 participants