[clang] [clang-tools-extra] [ExprMutation] handle return non-const type (PR #161396)

Changqing Jing via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 6 06:19:35 PDT 2025


================
@@ -787,13 +788,16 @@ ExprMutationAnalyzer::Analyzer::findPointeeToNonConst(const Expr *Exp) {
   // FIXME: false positive if the pointee does not change in lambda
   const auto CaptureNoConst = lambdaExpr(hasCaptureInit(Exp));
 
-  const auto Matches =
-      match(stmt(anyOf(forEachDescendant(
-                           stmt(anyOf(AssignToNonConst, PassAsNonConstArg,
-                                      CastToNonConst, CaptureNoConst))
-                               .bind("stmt")),
-                       forEachDescendant(InitToNonConst))),
-            Stm, Context);
+  const auto ReturnNoCost =
----------------
Changqing-JING wrote:

typo, should be ReturnNoConst

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


More information about the cfe-commits mailing list