[Bug c++/123700] [14/15/16 Regression] ICE in tsubst_lambda_expr with generic lambdas in template non-type parameter since r14-2170-g4cf64d9cc2faf4 (C++20)
ppalka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 26 19:37:57 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123700
--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
A workaround is to use an intermediate variable that holds the lambda:
template <typename> constexpr int zero = 0;
template <auto> struct Type;
int outer(auto) {
constexpr auto lambda = [](auto) {};
using inner = Type<lambda>;
return [](auto) { return zero<inner>; }(0);
}
int main() { outer(0); }
More information about the Gcc-bugs
mailing list