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

David Zbarsky via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 18:50:27 PDT 2026


dzbarsky wrote:

> Thanks for woking on binary size reduction!
> 
> But the self(self...) pattern is a known pre-C++23 idiom hack. Given that C++23 introduces a clean, native syntax for this ('deducing this'), this PR looks like adopting a temporary, unidiomatic workaround. That is, we get a relatively small reduction in size, but it seems we lose code readability.
> 
> Perhaps we can do without self(self,..) and consider each case of a recursive lambda individually. It seems more logical to use a local structure for selection/decl traversal, and a static function for Print.

Thanks for the suggestion, I think it comes out cleaner

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


More information about the cfe-commits mailing list