public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ruilvo at ua dot pt" <gcc-bugzilla@gcc.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:14:56 +0000	[thread overview]
Message-ID: <bug-108342-4-tsvsLgMfVi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108342-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108342

--- Comment #3 from Rui Oliveira <ruilvo at ua dot pt> ---
(In reply to Andrew Pinski from comment #1)
> 
> 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 _Complex
> ...

[complex.numbers.general] mentions:

If z is an lvalue of type cv complex<T> then: 
the expression reinterpret_­cast<cv T(&)[2]>(z) is well-formed,

https://eel.is/c++draft/complex.numbers.general

Basically stating that std::complex<T> is layouted exactly the same as T[2]. 

C standard says something similar iirc.

  parent reply	other threads:[~2023-01-09 16:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 12:57 [Bug c++/108342] New: " ruilvo at ua dot pt
2023-01-09 16:08 ` [Bug c++/108342] " pinskia at gcc dot gnu.org
2023-01-09 16:13 ` [Bug libstdc++/108342] " pinskia at gcc dot gnu.org
2023-01-09 16:14 ` ruilvo at ua dot pt [this message]
2023-01-09 16:16 ` ruilvo at ua dot pt
2023-01-09 16:17 ` redi at gcc dot gnu.org
2023-01-09 16:28 ` [Bug c++/108342] " pinskia at gcc dot gnu.org
2023-01-09 16:31 ` pinskia at gcc dot gnu.org
2023-01-09 16:37 ` pinskia at gcc dot gnu.org
2023-01-09 16:39 ` pinskia at gcc dot gnu.org
2023-01-09 21:23 ` ruilvo at ua dot pt
2023-01-09 21:34 ` jakub at gcc dot gnu.org
2023-01-09 21:40 ` ruilvo at ua dot pt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108342-4-tsvsLgMfVi@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).