[clang] [Clang] Diagnose function parameters used in lambda bodies in default arguments (PR #235057)
Usef Ahmed via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 24 03:32:56 PDT 2026
usefahmed07 wrote:
> > Everything works as expected.
>
> So, do you agree that this is a workaround?
>
> > ... If you have a more fundamental solution in mind, please let me know so we can discuss and implement it.
>
> We’ll do it only if you know the relevant codebase well enough. Chatting with AI on GitHub is a waste of time.
Yes, I agree it's a workaround. The early return in `tryCaptureVariable` from #93206 is already a workaround for how parameters are handled while parsing default arguments, and my change just adds a diagnostic inside it.
I used AI to help with the patch and tests, and I'm not familiar enough with this part of Sema yet to know the proper fix. I'll move the PR to draft and study the code more. If you have any suggestions on where the actual issue should be fixed, please let me know.
https://github.com/llvm/llvm-project/pull/235057
More information about the cfe-commits
mailing list