]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Treat unnamed bitfields as padding for __has_unique_object_representations ...
authorJakub Jelinek <jakub@redhat.com>
Tue, 14 Mar 2023 15:17:32 +0000 (16:17 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 3 May 2023 13:02:06 +0000 (15:02 +0200)
commit066de3a9bb2bc796cfc02767ab4d4440660f7086
tree7222a980694b79d4d04cfe0cd7efdf67f427ccd4
parent71ddae709ba21af895622d70480f5ebce0779723
c++: Treat unnamed bitfields as padding for __has_unique_object_representations [PR109096]

As reported in the PR, for __has_unique_object_representations we
were treating unnamed bitfields as named ones, which is wrong, they
are actually padding.

THe following patch fixes that.

2023-03-14  Jakub Jelinek  <jakub@redhat.com>

PR c++/109096
* tree.c (record_has_unique_obj_representations): Ignore unnamed
bitfields.

* g++.dg/cpp1z/has-unique-obj-representations3.C: New test.

(cherry picked from commit c35cf160a0ed81570cff6600dba465cf95fa80fa)
gcc/cp/tree.c
gcc/testsuite/g++.dg/cpp1z/has-unique-obj-representations3.C [new file with mode: 0644]