[clang-tools-extra] [clangd] Extract to Function: mark unmodified captured parameters const (PR #225666)

Christian Kandeler via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 28 06:03:21 PDT 2026


================
@@ -764,11 +986,13 @@ bool createParameters(NewFunction &ExtractedFunc,
       return false;
     // Parameter qualifiers are same as the Decl's qualifiers.
     QualType TypeInfo = VD->getType().getNonReferenceType();
-    // FIXME: Need better qualifier checks: check mutated status for
-    // Decl(e.g. was it assigned, passed as nonconst argument, etc)
-    // FIXME: check if parameter will be a non l-value reference.
-    // FIXME: We don't want to always pass variables of types like int,
-    // pointers, etc by reference.
----------------
ckandeler wrote:

Yes, this patch's scope is to change non-const ref to const ref where possible. Passing by value is planned for an extra patch. And while the above example looks weird, it is correct, as the pointer value is not modified.

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


More information about the cfe-commits mailing list