Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions abi.html
Original file line number Diff line number Diff line change
Expand Up @@ -1045,8 +1045,8 @@ <h3><a href="#class-types"> 2.4 Non-POD Class Types </a></h3>
to nvalign(D) for base classes or
to align(D) for data members.
Place D at this offset unless doing so would result in two
components (direct or indirect) of the same type having the
same offset.
components (direct or indirect) of the same type (ignoring
cv-qualifiers) having the same offset.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be top-level cv-qualifiers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, are you thinking of cv-qualifiers in template arguments? Empty types can't have non-top-level cv-qualifiers in the usual sense (and if they could, they should be ignored here too, because we don't want objects with similar types to have the same address).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Being clear about the qualifiers being ignored only being the top-level qualifiers seems like the right thing to do. If for some strange reason we ever add a new fundamental type that can be empty, the right default rule to apply here would be to ignore only the top-level qualifiers. A type similarity rule would necessarily be specific to the new fundamental type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can avoid the question entirely and specify the rule in terms of whether the types are similar. Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, that works.

If such a component type conflict occurs,
increment the candidate offset by nvalign(D)
for base classes or by align(D) for data members
Expand Down