[Bug c++/84492] New: [8 Regression] ICE with statement expression

reichelt at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 20 21:28:00 GMT 2018


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

            Bug ID: 84492
           Summary: [8 Regression] ICE with statement expression
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following (invalid?) code snippet triggers an ICE on trunk:

=============================
template<int> int foo()
{
  return ({ foo; });
}
=============================

bug.cc: In function 'int foo()':
bug.cc:3:19: internal compiler error: in instantiate_type, at cp/class.c:8012
   return ({ foo; });
                   ^
0x5dacc3 instantiate_type(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/class.c:8009
0x9e2f4a convert_for_assignment
        ../../gcc/gcc/cp/typeck.c:8779
0x9e442a check_return_expr(tree_node*, bool*)
        ../../gcc/gcc/cp/typeck.c:9372
0x99efce finish_return_stmt(tree_node*)
        ../../gcc/gcc/cp/semantics.c:891
0x91c2c4 cp_parser_jump_statement
        ../../gcc/gcc/cp/parser.c:12411
0x91c2c4 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:10816
0x91d040 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:11261
0x91d117 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:11215
0x933890 cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:21756
0x933890 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:21793
0x934140 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:26694
0x934e74 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:26610
0x934e74 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:19482
0x93b02a cp_parser_single_declaration
        ../../gcc/gcc/cp/parser.c:27150
0x93b16c cp_parser_template_declaration_after_parameters
        ../../gcc/gcc/cp/parser.c:26752
0x93ba2c cp_parser_explicit_template_declaration
        ../../gcc/gcc/cp/parser.c:26989
0x93ba2c cp_parser_template_declaration_after_export
        ../../gcc/gcc/cp/parser.c:27008
0x940d99 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:12716
0x941081 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:12643
0x941374 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4559
Please submit a full bug report, [etc.]


More information about the Gcc-bugs mailing list