[clang] [Clang][Sema] Fix lambdas mistakenly inheriting InImmediateFunctionContext (PR #232458)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 12:52:41 PDT 2026


efriedma-quic wrote:

I suspect the handling for non-call-operator methods on lambdas isn't what we want.

Defaulted special member functions are automatically immediate-escalating.  That implicitly everything except the lambdas's conversion operator, I think.  Probably the conversion operator should also be immediate-escalating.  (I think this is a gap in the standard: the standard says the function F is immediate if the call operator is immediate, but it doesn't mention anything about the conversion operator itself.)

Example:

```
auto a = []consteval{return 3;};
constexpr auto b = (+a)();
```

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


More information about the cfe-commits mailing list