Skip to content

[defns.dynamic.type] The note is misleading #257

Closed
cplusplus/draft
#6203
@xmh0511

Description

@xmh0511

Full name of submitter (unless configured in github; will be published with the issue): Jim X

If a pointer p whose static type is “pointer to class B” is pointing to an object of class D, derived from B, the dynamic type of the expression *p is “D”. References are treated similarly.

Since the pointer p already points to the subobject B, how does it simultaneously point to the containing object? The intent should be:

If a pointer p whose static type is “pointer to class B” points to an object that is a base class subobject of an object of class D derived from B, the dynamic type of the expression *p is D. References are treated similarly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions