https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101539
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #51192|0 |1 is obsolete| | Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org Status|NEW |ASSIGNED --- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 51241 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51241&action=edit gcc12-pr101539.patch Updated __is_layout_compatible trait patch that now also implements __builtin_is_corresponding_member. For now it implements the IMHO buggy but standard definition of layout-compatible and std::is_layout_compatible comments, including ignoring of alignment differences, mishandling of bitfields in unions and [[no_unique_address]] issues with empty classes. For __builtin_is_corresponding_member, it will sorry if corresponding members could have different offsets (doesn't do so during constant evaluation but unless one uses the builtin directly, even using std::is_corresponding_member in constant expressions only will result in instantiation of the template and the code in the template doesn't have constant arguments and so can emit sorry). For anonymous structs (GCC extension) it will recurse into the anonymous structs. For anonymous unions it will emit another sorry if it can't prove such member types can't appear in the anonymous unions or anonymous aggregates in that union, because corresponding member is defined only using common initial sequence which is only defined for std-layout non-union class types.