https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116987

            Bug ID: 116987
           Summary: Internal error checking coroutine final suspend self
                    reference
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kelbonage at gmail dot com
  Target Milestone: ---

Bug: gcc ICEs when final_suspend of coroutine returns reference to *this.
Code to reproduce may be found here: https://github.com/kelbon/kelcoro
commit before 23673c699423b8e0e0324c9d057368dbcdf4cfc2 (this commit work
arounds this gcc ICE by removing return *this from final_suspend of 2 coros)


example of gcc output:

 internal compiler error: in coro_diagnose_throwing_final_aw_expr, at
cp/coroutines.cc:897
   29 | }
      | ^
0x72c2f6 coro_diagnose_throwing_final_aw_expr
        ../../src/gcc/cp/coroutines.cc:897
0xf47d85 build_init_or_final_await
        ../../src/gcc/cp/coroutines.cc:2526
0xf49e75 coro_rewrite_function_body
        ../../src/gcc/cp/coroutines.cc:4307
0xf4ec39 morph_fn_to_coro(tree_node*, tree_node**, tree_node**)
        ../../src/gcc/cp/coroutines.cc:4454
0xfa6d43 finish_function(bool)
        ../../src/gcc/cp/decl.cc:18581
0x10b1ce7 cp_parser_function_definition_after_declarator
        ../../src/gcc/cp/parser.cc:32732
0x10b2e7e cp_parser_function_definition_from_specifiers_and_declarator
        ../../src/gcc/cp/parser.cc:32646
0x10b2e7e cp_parser_init_declarator
        ../../src/gcc/cp/parser.cc:23366
0x10864b4 cp_parser_simple_declaration
        ../../src/gcc/cp/parser.cc:15900
0x10bf61a cp_parser_declaration
        ../../src/gcc/cp/parser.cc:15573
0x10be209 cp_parser_toplevel_declaration
        ../../src/gcc/cp/parser.cc:15594
0x10be209 cp_parser_declaration_seq_opt
        ../../src/gcc/cp/parser.cc:15345
0x10be6ab cp_parser_namespace_body
        ../../src/gcc/cp/parser.cc:22128
0x10be6ab cp_parser_namespace_definition
        ../../src/gcc/cp/parser.cc:22106
0x10bfe06 cp_parser_declaration
        ../../src/gcc/cp/parser.cc:15553
0x10c04fa cp_parser_toplevel_declaration
        ../../src/gcc/cp/parser.cc:15594
0x10c04fa cp_parser_translation_unit
        ../../src/gcc/cp/parser.cc:5279
0x10c04fa c_parse_file()
        ../../src/gcc/cp/parser.cc:51268
0x1211639 c_common_parse_file()
        ../../src/gcc/c-family/c-opts.cc:1311

Reply via email to