https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121797
Bug ID: 121797
Summary: ICE on lambda-expression with invalid type
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: stevenxia990430 at gmail dot com
Target Milestone: ---
The following invalid program reports an internal compiler error: error
reporting routines re-entered. Failed on gcc-trunk.
To quickly reproduce: https://gcc.godbolt.org/z/9voTGoq55
```
#include <type_traits>
template <typename T>
struct LambdaWrapper {
auto operator()() -> decltype([]{ return typename T::type(); }) {
return []{ return 0;};
}
};
LambdaWrapper<int> lf;
constexpr auto x = lf();
```