Bug 107384 - [13 Regression] ICE tree check: expected non_lvalue_expr or static_cast_expr, have error_mark in set_implicit_rvalue_p, at cp/cp-tree.h:8689
Summary: [13 Regression] ICE tree check: expected non_lvalue_expr or static_cast_expr,...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 13.0
: P3 normal
Target Milestone: 13.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2022-10-24 17:57 UTC by G. Steinmetz
Modified: 2022-11-28 22:45 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description G. Steinmetz 2022-10-24 17:57:00 UTC
Started between 20220925 and 20221009 :
(gcc configured with --enable-checking=yes)


$ cat z1.cc
auto a = [] { b; return b; };


$ gcc-13-20221023 -c z1.cc -std=c++2b
z1.cc: In lambda function:
z1.cc:1:15: error: 'b' was not declared in this scope
    1 | auto a = [] { b; return b; };
      |               ^
z1.cc:1:25: internal compiler error: tree check: expected non_lvalue_expr or static_cast_expr, have error_mark in set_implicit_rvalue_p, at cp/cp-tree.h:8689
    1 | auto a = [] { b; return b; };
      |                         ^
0x7016f0 tree_check_failed(tree_node const*, char const*, int, char const*, ...)
        ../../gcc/tree.cc:8836
0xb31e9a tree_check2(tree_node*, char const*, int, char const*, tree_code, tree_code)
        ../../gcc/tree.h:3545
0xb31e9a set_implicit_rvalue_p(tree_node*)
        ../../gcc/cp/cp-tree.h:8689
0xb31e9a treat_lvalue_as_rvalue_p(tree_node*, bool)
        ../../gcc/cp/typeck.cc:10729
0xa5fb27 do_auto_deduction(tree_node*, tree_node*, tree_node*, int, auto_deduction_context, tree_node*, int)
        ../../gcc/cp/pt.cc:30472
0xb4fdd4 check_return_expr(tree_node*, bool*)
        ../../gcc/cp/typeck.cc:11002
0xad660e finish_return_stmt(tree_node*)
        ../../gcc/cp/semantics.cc:1230
0xa0449d cp_parser_jump_statement
        ../../gcc/cp/parser.cc:14311
0xa0449d cp_parser_statement
        ../../gcc/cp/parser.cc:12288
0xa04c34 cp_parser_statement_seq_opt
        ../../gcc/cp/parser.cc:12853
0xa04d17 cp_parser_compound_statement
        ../../gcc/cp/parser.cc:12805
0xa054da cp_parser_function_body
        ../../gcc/cp/parser.cc:25179
0xa054da cp_parser_lambda_body
        ../../gcc/cp/parser.cc:11762
0xa054da cp_parser_lambda_expression
        ../../gcc/cp/parser.cc:11085
0xa054da cp_parser_primary_expression
        ../../gcc/cp/parser.cc:5766
0xa08d9e cp_parser_postfix_expression
        ../../gcc/cp/parser.cc:7717
0xa20fef cp_parser_unary_expression
        ../../gcc/cp/parser.cc:9081
0x9ebd2f cp_parser_cast_expression
        ../../gcc/cp/parser.cc:9985
0x9ec65f cp_parser_binary_expression
        ../../gcc/cp/parser.cc:10087
0x9ed404 cp_parser_assignment_expression
        ../../gcc/cp/parser.cc:10427
Comment 1 Marek Polacek 2022-10-24 18:07:52 UTC
Just fixed by r13-3462.