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

            Bug ID: 93458
           Summary: ICE using coroutines
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tromey at gcc dot gnu.org
  Target Milestone: ---

I'm using git master gcc from today.

I tried a simple coroutine program:

int func(int *x) {
  for (int i = 0; i < 23; ++i)
    co_yield x[i];
}


Compiling causes gcc to ICE:

murgatroyd. ./install/bin/g++ -fcoroutines -g -c -o /tmp/qq.o /tmp/qq.cc
/tmp/qq.cc: In function ‘int func(int*)’:
/tmp/qq.cc:3:5: error: cannot find ‘coroutine traits’ template
    3 |     co_yield x[i];
      |     ^~~~~~~~
/tmp/qq.cc:3:17: internal compiler error: in coro_promise_type_found_p, at
cp/coroutines.cc:390
    3 |     co_yield x[i];
      |                 ^
0x5ff2fd coro_promise_type_found_p
        ../../gcc/gcc/cp/coroutines.cc:390
0x94aeae finish_co_yield_expr(unsigned int, tree_node*)
        ../../gcc/gcc/cp/coroutines.cc:862
0xa163a0 cp_parser_yield_expression
        ../../gcc/gcc/cp/parser.c:26176
0xa163a0 cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:9816
0xa1668d cp_parser_expression
        ../../gcc/gcc/cp/parser.c:9992
0xa19498 cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:11633
0xa250e3 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:11429
0xa45c36 cp_parser_already_scoped_statement
        ../../gcc/gcc/cp/parser.c:13198
0xa45f24 cp_parser_iteration_statement
        ../../gcc/gcc/cp/parser.c:12848
0xa25154 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:11298
0xa26792 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:11780
0xa26868 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:11730
0xa3f085 cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:22963
0xa3f085 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:23014
0xa42421 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:28846
0xa431c1 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:28762
0xa431c1 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:20590
0xa22eb3 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:13669
0xa4b197 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:13368
0xa4b917 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4731
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to