From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9AA363840C35; Fri, 10 Jul 2020 12:36:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9AA363840C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594384612; bh=SniNVqWx268E3MnmOvcYvBv/AVEy1nEFWR9KOeaHDAE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=m9XkgX4TxiN9K58yqDLWDTzE6PhN0NfzONH0GEtFvOEpPEYIIKI3YIA18+sErqI6t 1PoMmXzqQx2G4NpJddCj+PTFpbXbeKdCu1HeMsRZ6c8ZM1wTb5YYW7/+cpSaIFQXp9 NM/Q9quaVrTnvwzOYjQiFBxy2RI9U6m9BV3WWMFQ= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95976] [[no_unique_address]] on union members has the opposite-of-intended effect Date: Fri, 10 Jul 2020 12:36:52 +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: 10.1.0 X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason 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: Fri, 10 Jul 2020 12:36:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95976 --- Comment #4 from CVS Commits --- The master branch has been updated by Jason Merrill : https://gcc.gnu.org/g:e47dfca5aa473e77fdff95d631dc39de87a41eec commit r11-2014-ge47dfca5aa473e77fdff95d631dc39de87a41eec Author: Jason Merrill Date: Thu Jul 9 15:11:12 2020 -0400 c++: [[no_unique_address]] fixes. [PR96105] We were wrongly checking is_empty_class on the result of strip_array_ty= pes rather than the actual field type. We weren't considering the alignmen= t of the data member. We needed to handle unions the same way as layout_nonempty_base_or_field. gcc/cp/ChangeLog: PR c++/96105 PR c++/96052 PR c++/95976 * class.c (check_field_decls): An array of empty classes is not= an empty data member. (layout_empty_base_or_field): Handle explicit alignment. Fix union handling. gcc/testsuite/ChangeLog: PR c++/96105 PR c++/96052 PR c++/95976 * g++.dg/cpp2a/no_unique_address4.C: New test. * g++.dg/cpp2a/no_unique_address5.C: New test. * g++.dg/cpp2a/no_unique_address6.C: New test.=