From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1F621385480B; Wed, 21 Jul 2021 15:12:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F621385480B From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101539] [C++20] Implement builtins for layout-compatibility and pointer-interconvertibility traits Date: Wed, 21 Jul 2021 15:12:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 15:12:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101539 --- Comment #3 from Jakub Jelinek --- I think the implementation of is_corresponding_member heavily depends on layout-compatibility ensuring the same sizes and alignments of the members, otherwise any comparison of the OFFSET_TYPE values (which just hold at runtime byte offset from the start of struct and at compile time hold also the type of t= he pointed non-static data member and type of the object the offset is relative to) is going to be a nighmare. So I think we first need a clarification of= the standard for the various alignas cases or the [[no_unique_address]] cases t= hat are shown e.g. in the #c1 testcase and only when we can count on the corresponding members to have the exact same offset we can move further on.=