From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E96A73858D1E; Mon, 9 Jan 2023 16:31:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E96A73858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673281906; bh=bIY79jZXzjv3IiY6+PsHBwsbHmLF0w/B8KGXtZQnjLQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZiRszR8YWk6NRLUEclztnhXz038HSMr3q5TW8TaX/3Nu0l+kz6wC/Vecvlqj6qWEJ 8Y0UGvByPDUIP5/Pby/UwtQQphqzz42gp7NaZO7C6DvyzZA7We01yEebK22PJGCPW+ DqVdYKsp2vKSzZdzSSeMSe8e8SbvnZM5aJYBL59g= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108342] std::complex: ignoring packed attribute because of unpacked non-POD field Date: Mon, 09 Jan 2023 16:31:46 +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.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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 #7 from Andrew Pinski --- (In reply to Jonathan Wakely from comment #5) > I don't know whether clang allows packing non-PODs, or just doesn't ever > warn 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). clang allows packing of non-PODs: ``` class f { public: f(); private: int t[2]; }; typedef struct __attribute__((__packed__)) { /** Every frame starts with BB_FRAME_MAGIC. */ unsigned magic; unsigned char t; f bb_iq_samples[100]; } bb_frame_t; ```=