Skip to content

fix(folding): correct unique object rep checks [] - #326

Open
jakub-labenski wants to merge 1 commit into
edgcpp:mainfrom
jakub-labenski:has_unique_object_representations
Open

jakub-labenski wants to merge 1 commit into
edgcpp:mainfrom
jakub-labenski:has_unique_object_representations

Conversation

@jakub-labenski

Copy link
Copy Markdown

Discussion: #290

Fix __has_unique_object_representations for several cases:

  • A base class with no direct nonstatic data members that inherits some (and is thus not empty) was treated as an empty base. Its size was counted as tail padding, making the trait incorrectly FALSE for derived classes. Use is_empty_class_type instead of checking for an empty field list.

  • Treat unnamed bit-fields of nonzero width as padding in Clang 17+ and g++ 13.1+ (also g++ 10.5, 11.4, 12.3 backports).

  • Restrict treating volatile-qualified non-class types as lacking unique object representations to g++ modes before version 10, and no longer apply it in Clang modes.

Add regression test has-unique-object-rep-inherited-base and update expectations for imported Clang type-traits and g++ has-unique-obj-representations3 tests.

Fix __has_unique_object_representations for several cases:

- A base class with no direct nonstatic data members that inherits
  some (and is thus not empty) was treated as an empty base. Its size
  was counted as tail padding, making the trait incorrectly FALSE for
  derived classes. Use is_empty_class_type instead of checking for an
  empty field list.

- Treat unnamed bit-fields of nonzero width as padding in Clang 17+
  and g++ 13.1+ (also g++ 10.5, 11.4, 12.3 backports).

- Restrict treating volatile-qualified non-class types as lacking
  unique object representations to g++ modes before version 10, and
  no longer apply it in Clang modes.

Add regression test has-unique-object-rep-inherited-base and update
expectations for imported Clang type-traits and g++
has-unique-obj-representations3 tests.

This branch has not been deployed

No deployments
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.

1 participant