public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "klaus.doldinger64 at googlemail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/93121] std::bit_cast missing Date: Fri, 04 Dec 2020 08:30:47 +0000 [thread overview] Message-ID: <bug-93121-4-cxlEz483hk@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-93121-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93121 --- Comment #12 from Wilhelm M <klaus.doldinger64 at googlemail dot com> --- The following does not work: # include <cstdint> # include <cstring> # include <cstddef> # include <bit> # include <array> using to_t = std::array<int16_t, 2>; int main() { constexpr std::byte from1[4]{}; constexpr auto v1 = std::bit_cast<to_t>(from1); return v1[0]; } gives: /usr/local/include/c++/11.0.0/bit: In function 'int main()': /home/lmeier/Projekte/wmucpp/host/test88.cc:11:50: in 'constexpr' expansion of 'std::bit_cast<std::array<short int, 2>, std::byte [4]>(from1)' /usr/local/include/c++/11.0.0/bit:60:33: sorry, unimplemented: '__builtin_bit_cast' cannot be constant evaluated because the argument cannot be encoded 60 | return __builtin_bit_cast(_To, __from); | ^~~
next prev parent reply other threads:[~2020-12-04 8:30 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-93121-4@http.gcc.gnu.org/bugzilla/> 2020-06-10 4:43 ` lyberta at lyberta dot net 2020-07-16 16:15 ` jakub at gcc dot gnu.org 2020-07-17 11:59 ` jakub at gcc dot gnu.org 2020-07-17 16:24 ` jakub at gcc dot gnu.org 2020-07-17 16:27 ` jakub at gcc dot gnu.org 2020-07-20 8:09 ` cvs-commit at gcc dot gnu.org 2020-07-20 8:25 ` cvs-commit at gcc dot gnu.org 2020-12-03 14:49 ` cvs-commit at gcc dot gnu.org 2020-12-03 19:17 ` cvs-commit at gcc dot gnu.org 2020-12-03 19:26 ` redi at gcc dot gnu.org 2020-12-04 8:30 ` klaus.doldinger64 at googlemail dot com [this message] 2020-12-04 10:45 ` jakub at gcc dot gnu.org 2020-12-04 17:02 ` cvs-commit at gcc dot gnu.org
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-93121-4-cxlEz483hk@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: linkBe 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).