public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vincent.hamp at higaski dot at" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94422] New: static_cast from std::array to enum class Date: Tue, 31 Mar 2020 09:41:09 +0000 [thread overview] Message-ID: <bug-94422-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94422 Bug ID: 94422 Summary: static_cast from std::array to enum class Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vincent.hamp at higaski dot at Target Milestone: --- static_cast from std::array operator[] to an enum class inside a template class produces an unexpected expression error. It seems that error is only present in 9.3, 9.2 and trunk work. #include <array> #include <cstdint> enum class EnumC : int8_t { Forward = 1, Backward = -1 }; std::array<uint8_t, sizeof(EnumC)> buf; template <typename T> struct S { void foo() { auto const cast_to_enum{static_cast<EnumC>(buf[0])}; } }; S<int> s;
next reply other threads:[~2020-03-31 9:41 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-31 9:41 vincent.hamp at higaski dot at [this message] 2020-03-31 10:17 ` [Bug c++/94422] [9 Regression] static_cast from std::array operator[] " redi at gcc dot gnu.org 2020-03-31 10:24 ` [Bug c++/94422] [9/10 " redi at gcc dot gnu.org 2020-03-31 11:59 ` [Bug c++/94422] [9 " rguenth at gcc dot gnu.org 2020-03-31 16:23 ` jakub at gcc dot gnu.org 2021-06-01 8:17 ` rguenth at gcc dot gnu.org 2022-05-27 8:50 ` rguenth 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-94422-4@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).