[clang] [Clang] Skip past code generation for unevaluated lambdas (PR #124572)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 27 13:31:47 PST 2025


efriedma-quic wrote:

Looking a bit more, I'm not sure I buy the premise that we don't need to mangle lambdas written in unevaluated contexts.  Consider the following related example:

```
template<class Tp>
using simd_vector = Tp;

template<class VecT>
using simd_vector_underlying_type_t
    = decltype([]<class Tp>(simd_vector<Tp>) { return 3; });

template<class VecT>
auto temp() {
  return [](simd_vector_underlying_type_t<VecT> x) { return x(10); };
}

int call() {
  return temp<simd_vector<char>>()({}); 
}
```

Both gcc and MSVC seem perfectly happy with this.

https://github.com/llvm/llvm-project/pull/124572


More information about the cfe-commits mailing list