public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "sam at gentoo dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105931] [12 regression] ICE in cxx_eval_constant_expression Date: Sun, 12 Jun 2022 04:50:01 +0000 [thread overview] Message-ID: <bug-105931-4-pz3gsvIArp@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105931-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105931 --- Comment #2 from Sam James <sam at gentoo dot org> --- Interesting! The minimised version of this is: ``` $ cat test.cxx template <unsigned ElemSize> decltype(0 % ElemSize == 0) ``` ``` $ g++ -o test.o -c -O2 test.cxx new.cxx:1:52: internal compiler error: unexpected expression ‘ElemSize’ of kind template_parm_index 1 | template <unsigned ElemSize> decltype(0 % ElemSize == 0) | ~~~~~~~~~~~~~^~~~ 0x6def33 cxx_eval_constant_expression /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/constexpr.cc:7587 0x6df310 cxx_eval_outermost_constant_expr /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/constexpr.cc:7824 0x6e154d potential_constant_expression_1 /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/constexpr.cc:9274 0x6e1ef5 potential_constant_expression_1(tree_node*, bool, bool, bool, int) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/constexpr.cc:9550 0x6e1ef5 is_constant_expression(tree_node*) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/constexpr.cc:9607 0x6e1ef5 is_nondependent_constant_expression(tree_node*) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/constexpr.cc:9644 0x6e2b04 maybe_constant_value(tree_node*, tree_node*, bool) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/constexpr.cc:8071 0x74e35b fold_for_warn(tree_node*) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/expr.cc:416 0x8c9552 shorten_compare(unsigned int, tree_node**, tree_node**, tree_node**, tree_code*) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/c-family/c-common.cc:3237 0x889d72 cp_build_binary_op(op_location_t const&, tree_code, tree_node*, tree_node*, int) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/typeck.cc:6158 0x6bd96c build_new_op(op_location_t const&, tree_code, int, tree_node*, tree_node*, tree_node*, tree_node*, tree_node**, int) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/call.cc:6935 0x88041b build_x_binary_op(op_location_t const&, tree_code, tree_node*, tree_code, tree_node*, tree_code, tree_node*, tree_node**, int) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/typeck.cc:4563 0x81f7e7 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/pt.cc:20369 0x82337a instantiate_non_dependent_expr_internal(tree_node*, int) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/pt.cc:6367 0x82337a instantiate_non_dependent_expr_sfinae(tree_node*, int) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/pt.cc:6388 0x85eec3 finish_decltype_type(tree_node*, bool, int) /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/semantics.cc:11255 0x7e183f cp_parser_decltype /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/parser.cc:16540 0x7fa3e7 cp_parser_simple_type_specifier /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/parser.cc:19647 0x7d6cbd cp_parser_type_specifier /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/parser.cc:19424 0x7d7d81 cp_parser_decl_specifier_seq /usr/src/debug/sys-devel/gcc-12.1.1_p20220611/gcc-12-20220611/gcc/cp/parser.cc:15905 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://bugs.gentoo.org/> for instructions. ``` This minimised version is only slightly different to the one in the original bug.
next prev parent reply other threads:[~2022-06-12 4:50 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-12 0:14 [Bug c++/105931] New: " sam at gentoo dot org 2022-06-12 0:15 ` [Bug c++/105931] " sam at gentoo dot org 2022-06-12 4:50 ` sam at gentoo dot org [this message] 2022-06-12 16:42 ` [Bug c++/105931] [12/13 " pinskia at gcc dot gnu.org 2022-06-12 16:47 ` pinskia at gcc dot gnu.org 2022-06-13 13:01 ` mpolacek at gcc dot gnu.org 2022-06-17 7:37 ` pinskia at gcc dot gnu.org 2022-06-19 19:01 ` ppalka at gcc dot gnu.org 2022-06-23 20:38 ` cvs-commit at gcc dot gnu.org 2022-06-24 13:21 ` cvs-commit at gcc dot gnu.org 2022-06-24 13:31 ` ppalka 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-105931-4-pz3gsvIArp@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).