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

            Bug ID: 123566
           Summary: [16 Regression] ICE in finish_expr_stmt, at
                    cp/semantics.cc:1171
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jirehguo at tju dot edu.cn
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/433TM34TW
The following c++ code crash gcc trunk.
But 13,14,15 with checking is fine.

Code:
```cpp
template <auto =
              [] {
                struct {
                } s;
              }>
bool v;
v<>
```

Stack dump:
```
<source>: In lambda function:
<source>:4:19: internal compiler error: in finish_expr_stmt, at
cp/semantics.cc:1171
    4 |                 } s;
      |                   ^
0x2926688 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x291b44b internal_error(char const*, ...)
        ???:0
0xb16d54 fancy_abort(char const*, int, char const*)
        ???:0
0xc1f523 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int,
cp_decomp*)
        ???:0
0xd81555 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xda156d coerce_template_parms(tree_node*, tree_node*, tree_node*, int, bool)
        ???:0
0xda418b lookup_template_variable(tree_node*, tree_node*, int)
        ???:0
0xd57563 c_parse_file()
        ???:0
0xec8ee9 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```

Reply via email to