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

            Bug ID: 89391
           Summary: [9 Regression] ICE in build_target_expr_with_type, at
                    cp/tree.c:795
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20180513 and 20180527 :


$ cat z1.cc
struct S { };
void f ()
{
  auto a = reinterpret_cast<S&&>(f());
}


$ g++-9-20180513 -c z1.cc
z1.cc: In function 'void f()':
z1.cc:4:37: error: invalid cast of an rvalue expression of type 'void' to type
'S&&'
   auto a = reinterpret_cast<S&&>(f());
                                     ^

$ g++-9-20190217 -c z1.cc
z1.cc: In function 'void f()':
z1.cc:4:37: internal compiler error: in build_target_expr_with_type, at
cp/tree.c:795
    4 |   auto a = reinterpret_cast<S&&>(f());
      |                                     ^
0x735f8e build_target_expr_with_type(tree_node*, tree_node*, int)
        ../../gcc/cp/tree.c:795
0x745452 build_reinterpret_cast_1
        ../../gcc/cp/typeck.c:7484
0x745863 build_reinterpret_cast(tree_node*, tree_node*, int)
        ../../gcc/cp/typeck.c:7676
0x6c035c cp_parser_postfix_expression
        ../../gcc/cp/parser.c:6876
0x6cc015 cp_parser_unary_expression
        ../../gcc/cp/parser.c:8459
0x6a9fef cp_parser_cast_expression
        ../../gcc/cp/parser.c:9345
0x6aa7c2 cp_parser_binary_expression
        ../../gcc/cp/parser.c:9446
0x6ab559 cp_parser_assignment_expression
        ../../gcc/cp/parser.c:9742
0x6aaf4d cp_parser_constant_expression
        ../../gcc/cp/parser.c:10026
0x6ab501 cp_parser_initializer_clause
        ../../gcc/cp/parser.c:22702
0x6aeabf cp_parser_initializer
        ../../gcc/cp/parser.c:22642
0x6d18ad cp_parser_init_declarator
        ../../gcc/cp/parser.c:20378
0x6b70be cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13476
0x6b8be9 cp_parser_declaration_statement
        ../../gcc/cp/parser.c:12906
0x6b962f cp_parser_statement
        ../../gcc/cp/parser.c:11230
0x6ba490 cp_parser_statement_seq_opt
        ../../gcc/cp/parser.c:11592
0x6ba53f cp_parser_compound_statement
        ../../gcc/cp/parser.c:11546
0x6d0d00 cp_parser_function_body
        ../../gcc/cp/parser.c:22562
0x6d0d00 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/cp/parser.c:22599
0x6d0fe0 cp_parser_function_definition_after_declarator
        ../../gcc/cp/parser.c:27666

Reply via email to