public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107024] ICE in finish_expr_stmt, at cp/semantics.cc:872 Date: Mon, 26 Sep 2022 12:27:45 +0000 [thread overview] Message-ID: <bug-107024-4-ZZJctYbes4@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107024-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107024 --- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> --- Test-case: #include <iostream> #include <utility> #include <vector> template <size_t...NN> struct Integral_pack { static constexpr size_t data[sizeof...(NN)] = { NN... }; std::vector<size_t> vec { NN... }; }; template <size_t N, auto Exp, size_t...NN> consteval auto apply_fold_impl(std::index_sequence<NN...>) { return Integral_pack<Exp(N, NN)...>{}; }; template <size_t N, auto Exp, size_t C> consteval auto apply_fold() { return apply_fold_impl<N, Exp>(std::make_index_sequence<C>{}); } template <size_t N, size_t C> using left_shift = decltype(apply_fold<N, [](size_t L, size_t R) { return (L << R); }, C>()); template <size_t N, size_t C> auto ls_vec = left_shift<N, C>{}.vec; template <size_t N, size_t C> using right_shift = decltype(apply_fold<N, [](size_t L, size_t R) { return (L >> R); }, C>()); template <size_t N, size_t C> std::vector<size_t> rs_vec = right_shift<N, C>{}.vec; int main() { for(auto& i : ls_vec<12351, 15>) std::cout << i << " "; std::cout << "\n"; for(auto& i : rs_vec<12351, 15>) std::cout << i << " "; std::cout << "\n"; }
next prev parent reply other threads:[~2022-09-26 12:27 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-24 4:06 [Bug c++/107024] New: " alex at clmbng dot com 2022-09-26 11:45 ` [Bug c++/107024] " marxin at gcc dot gnu.org 2022-09-26 12:27 ` marxin at gcc dot gnu.org [this message] 2022-09-27 0:57 ` alex at clmbng dot com 2022-09-27 8:15 ` marxin at gcc dot gnu.org 2024-04-13 20:44 ` pinskia 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-107024-4-ZZJctYbes4@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).