From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4BC263858CDA; Mon, 9 Jan 2023 16:14:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BC263858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673280897; bh=q1rTB8hin9RBdXf2P3po9q30AKOCjEN+euSzqjunhVo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eQHjA4oz6Ga/Rzwq7y2k0EIWVJKi3yxbkVaJs8RDnuKfSIdEl3nd0afDO2P5Ugn0t 8nrHTBqKNCncuPwho1TLpMcZ93yQiPekegIwjqP5MFgywt12Rj2byUjoWdSXSKhMHB RAICnDJzFQrHzfM0CO8Xvh6Y4QjGQfzCiZzEb9nQ= From: "ruilvo at ua dot pt" 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:14:56 +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: ruilvo at ua dot pt 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 #3 from Rui Oliveira --- (In reply to Andrew Pinski from comment #1) >=20 > I know about _Atomic and std::atomic but not std::complex and _Complex. > Because std::complex was part of C++98 which was done before C99's _Compl= ex > ... [complex.numbers.general] mentions: If z is an lvalue of type cv complex then:=20 the expression reinterpret_=C2=ADcast(z) is well-formed, https://eel.is/c++draft/complex.numbers.general Basically stating that std::complex is layouted exactly the same as T[2]= .=20 C standard says something similar iirc.=