From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BEEC9385B508; Mon, 9 Jan 2023 16:17:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEEC9385B508 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673281054; bh=v0N3Ld6WTtY4aShzRRF2tQa9yAV4Lcnj0SOhSk7tp50=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XpVtBXAp1B4ysjE38WWlPihXHGoSBUoXYhvLTj9IYomo6/OnCt83zfOfbCp38fnp4 Ij2C8p60SeRuxuVNdwusZnFWZErT8dwDyYvGmLGyRkJKbPZY4w6e8xA7qwfs5AimKq uOJpJ85+MZLwfNZ/98LdetKN8q0XBTSOJ1NznOU8= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/108342] std::complex: ignoring packed attribute because of unpacked non-POD field Date: Mon, 09 Jan 2023 16:17:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108342 --- Comment #5 from Jonathan Wakely --- I don't think there's anything the library can do here. The layout of std::complex is fixed, as stated above. And the fact it's a non-POD is also fixed. If the front-end warns about trying to pack a non-POD, then the library can= 't stop it warning about std::complex. I don't know whether clang allows packing non-PODs, or just doesn't ever wa= rn for them, or has a special case for std::complex, or does something smarter like not warn for types that have no padding bytes anyway (so that packing = them would be a no-op).=