Skip to content

[defns.dynamic.type] Say "most derived object" in the example #6203

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

Merged
merged 2 commits into from
Jun 17, 2025

Conversation

frederick-vs-ja
Copy link
Contributor

and

  • don't say the static type of a pointer, because the difference between static and dynamic types is only present for glvalues of class types;
  • say that the B* pointer is pointing to a B base class subobject, which avoids involving problematic cases of reinterpret_cast or static_cast from cv void* (see [expr.static.cast]/14).

Fixes #5762.
Fixes cplusplus/CWG#257.

frederick-vs-ja and others added 2 commits March 25, 2023 16:41
@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 17, 2025

@jensmaurer: Could you have a look?

Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

@tkoeppe tkoeppe merged commit da436f8 into cplusplus:main Jun 17, 2025
@frederick-vs-ja frederick-vs-ja deleted the most-derived branch June 17, 2025 23:20
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 this pull request may close these issues.

[defns.dynamic.type] The note is misleading [defns.dynamic.type] A misleading note
4 participants