[clang] [Clang][AST/Sema] Fix lambda function pointer conversion operator immediate escalation (PR #235356)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 24 17:51:21 PDT 2026


efriedma-quic wrote:

The standard isn't particularly clear about what counts as an "immediate invocation".  But I think the rule is supposed to be that a call doesn't count as an immediate invocation unless the callee is actually an identifier naming an immediate function.

Whatever gcc is doing seems hard to justify.

```
consteval int g() {return 3;}
int main() {
    auto b = (!__builtin_is_constant_evaluated() ? g : 0)();
    return b;
}
```

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


More information about the cfe-commits mailing list