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] Incorrect cross-references #4004

Closed
kalaider opened this issue May 20, 2020 · 3 comments · Fixed by #4007
Closed

[class] Incorrect cross-references #4004

kalaider opened this issue May 20, 2020 · 3 comments · Fixed by #4007
Assignees

Comments

@kalaider
Copy link

Some examples:

  1. From [class.derived]. [basic.stc] is about storage duration, not layout. [expr.eq] is completely unrelated.

    draft/source/classes.tex

    Lines 3588 to 3597 in fc974c3

    \begin{note}
    A base class subobject might have a layout\iref{basic.stc} different
    from the layout of a most derived object of the same type. A base class
    subobject might have a polymorphic behavior\iref{class.cdtor}
    different from the polymorphic behavior of a most derived object of the
    same type. A base class subobject may be of zero size\iref{class};
    however, two subobjects that have the same class type and that belong to
    the same most derived object must not be allocated at the same
    address\iref{expr.eq}.
    \end{note}
  2. From [class.access.spec]. [expr.rel] does not describe allocation order at all (and probably never did).

    draft/source/classes.tex

    Lines 4714 to 4717 in fc974c3

    \begin{note}
    The effect of access control on the order of allocation
    of data members is specified in~\ref{expr.rel}.
    \end{note}

The list is incomplete. Most broken references (if not all) point to either [basic] or [expr]. Other clauses seem more accurate.

@jensmaurer
Copy link
Member

jensmaurer commented May 21, 2020

Regarding [class.derived], [expr.eq] p3.3 actually requires (indirectly) that comparisons of pointers to different complete objects of non-zero size yield the result "unequal", so this is in fact relevant. However, [intro.object] is probably a better reference. I agree the reference to [basic.stc] is bogus.

Regarding [class.access.spec], [expr.rel] p4.2 indeed discusses order of allocation, because pointer comparisons (but nothing else) induce constraints on the allocation order.

@kalaider
Copy link
Author

Thanks for commenting on this.

Careful reading of [expr.eq] proved I jumped to somewhat wrong conclusions. However, it is still better to add some informal note regarding this directly under [expr.eq] subclause. [intro.object] addresses the issue directly, so, probably, the best solution is just to use it in place of [expr.eq].

In the passage from [class.access.spec] order of allocation is a bit confusing. [class.mem]/19 is about the same but its wording is much clearer. I missed that in essence subsequent allocations give higher addresses; without that the passage is pointless.

Also, I'll edit the title of the issue to be less radical.

@kalaider kalaider changed the title [class] Lots of incorrect cross-references [class] Incorrect cross-references May 21, 2020
@jensmaurer
Copy link
Member

[class.mem] p19 is a note; everything there should be expressed normatively elsewhere.

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