[Bug c++/107148] New: [10/11/12/13 Regression] ICE in bot_manip, at cp/tree.cc:3252

asolokha at gmx dot com gcc-bugzilla@gcc.gnu.org
Tue Oct 4 06:26:03 GMT 2022


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


More information about the Gcc-bugs mailing list