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

            Bug ID: 128500
           Summary: internal compiler error: tree check: expected
                    function_type or method_type, have void_type in
                    type_noexcept_p, at cp/except.cc
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 0599jiangyc at gmail dot com
  Target Milestone: ---

The following code:
```cpp
void *g;
template <class T>
int f1 (T t)
{
  return [t] { return g (t); } ();
}
```

Resulted in this output:
```
<source>:5:25: internal compiler error: tree check: expected function_type or
method_type, have void_type in type_noexcept_p, at cp/except.cc:1231
```

Trunk reproducer (`-std=c++26`): https://godbolt.org/z/zj8nqbP5x

Reply via email to