[clang-tools-extra] [clang-tidy][false-positive] misc-const-correctness warns for expression dependent on pack expansion (PR #245347)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 23 12:47:34 PST 2026
================
@@ -216,6 +216,26 @@ static bool isStdMoveOperandInTemplate(const VarDecl *Variable,
return false;
}
+/// Find the local variable in the body of the template pattern \p Pattern
+/// from which \p Variable was instantiated. There is no direct link from an
+/// instantiated local variable to its pattern, but instantiated declarations
+/// keep the source location of their pattern.
+///
+/// Returns null if the pattern variable has a dependent type, because the
+/// mutation analysis is too conservative for such variables to be useful.
+static const VarDecl *getPatternVariable(const VarDecl *Variable,
+ const Stmt *PatternBody,
+ ASTContext &Context) {
+ for (const BoundNodes &Nodes :
----------------
jsack32 wrote:
Good point. I will make it lazily run only when a template instantiation shows no mutations.
https://github.com/llvm/llvm-project/pull/245347
More information about the cfe-commits
mailing list