[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:55:40 GMT 2026


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

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
This is a latent issue, and r14-2170 just made it affect variable templates as
well.

Here's a version of the testcase that uses a class instead of variable template
that we always ICEd on:

template <typename> struct zero_t { };
template <auto> struct Type;

template<class T>
auto outer(T) {
  using inner = Type<[](auto) {}>;
  return [](auto) { return zero_t<inner>{}; }(0);
}

int main() { outer(0); }


To fix this I think we need to make dependent_opaque_alias_p return true
whenever the aliased type contains a lambda subexpression, such as with the
alias 'inner'.


More information about the Gcc-bugs mailing list