[clang-tools-extra] [clangd] Avoid type erasure for local recursive callbacks (PR #203042)

Safocl Stollmannovic via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 20 09:26:00 PDT 2026


safocl wrote:

Could you please tell me what I'm doing wrong? In my example at https://godbolt.org/z/5dhWK7rGx, Clang generates an empty function with the "-O1" flag and higher, but generates code with the "-O0" flag (as if there's undefined behavior somewhere).
I wanted to compare how well the new function wrappers perform compared to these changes. In the case of GCC, it potentially generates less code for `std::function_ref` compared to implementing it via a custom structure.

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


More information about the cfe-commits mailing list