public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107148] New: [10/11/12/13 Regression] ICE in bot_manip, at cp/tree.cc:3252 Date: Tue, 04 Oct 2022 06:26:03 +0000 [thread overview] Message-ID: <bug-107148-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107148 Bug ID: 107148 Summary: [10/11/12/13 Regression] ICE in bot_manip, at cp/tree.cc:3252 Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- g++ 13.0.0 20220925 snapshot (g:77bbf69d2981dafc2ef3e59bfbefb645d88bab9d) ICEs when compiling the following testcase, reduced from test/Sema/stmt-expr-in-default-arg.cpp from the clang 15.0.1 test suite: template <typename Callable> int bar(Callable &&Call) { return Call(); } int baz() { auto l = [](int a = ({ int x = 12; x; })) { return 1; }; return bar(l); } % g++-13.0.0 -c wi2ugigv.cpp wi2ugigv.cpp: In function 'int baz()': wi2ugigv.cpp:7:30: error: ISO C++ forbids in-class initialization of non-const static member 'baz()::<lambda>::x' 7 | auto l = [](int a = ({ int x = 12; x; })) { // expected-error {{default argument may not use a GNU statement expression}} | ^ wi2ugigv.cpp:7:38: error: 'x' was not declared in this scope 7 | auto l = [](int a = ({ int x = 12; x; })) { // expected-error {{default argument may not use a GNU statement expression}} | ^ wi2ugigv.cpp:7:23: error: could not convert '({...})' from 'void' to 'int' 7 | auto l = [](int a = ({ int x = 12; x; })) { // expected-error {{default argument may not use a GNU statement expression}} | ^~~~~~~~~~~~~~~~~~~~ | | | void wi2ugigv.cpp: In instantiation of 'int bar(Callable&&) [with Callable = baz()::<lambda(int)>&]': wi2ugigv.cpp:10:13: required from here wi2ugigv.cpp:3:14: internal compiler error: in bot_manip, at cp/tree.cc:3252 3 | return Call(); | ~~~~^~ 0x75052d bot_manip /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/tree.cc:3252 0x14f3003 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/tree.cc:11249 0xbd29f8 break_out_target_exprs(tree_node*, bool) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/tree.cc:3333 0x96fd52 convert_default_arg(tree_node*, tree_node*, tree_node*, int, int) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/call.cc:8755 0x97d73f build_over_call /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/call.cc:9655 0x981621 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/call.cc:5137 0xbad4a1 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/semantics.cc:2925 0xb59a1d tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/pt.cc:21204 0xb6f001 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/pt.cc:19722 0xb7036f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/pt.cc:18707 0xb6fdcd tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/pt.cc:19059 0xb837b6 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/pt.cc:18683 0xb837b6 instantiate_body /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/pt.cc:26657 0xb84994 instantiate_decl(tree_node*, bool, bool) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/pt.cc:26949 0xb903b3 instantiate_pending_templates(int) /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/pt.cc:27027 0xa3e5cc c_parse_final_cleanups() /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/decl2.cc:4917 0xc6e3cf c_common_parse_file() /var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/c-family/c-opts.cc:1273
next reply other threads:[~2022-10-04 6:26 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-04 6:26 asolokha at gmx dot com [this message] 2022-10-04 8:44 ` [Bug c++/107148] " marxin at gcc dot gnu.org 2022-10-04 14:01 ` mpolacek at gcc dot gnu.org 2022-10-06 10:08 ` rguenth at gcc dot gnu.org 2022-11-16 22:00 ` jsm28 at gcc dot gnu.org 2023-07-07 10:44 ` [Bug c++/107148] [11/12/13/14 Regression] ICE in bot_manip with statement expressions, " 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-107148-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).