================ @@ -159,11 +263,56 @@ AST_MATCHER_P(DeclRefExpr, doesNotMutateObject, int, Indirections) { // The method call cannot mutate our variable. continue; } + if (isLikelyShallowConst(*Method)) { + // We still have to check that the object is not modified through + // the method's return value (C). + const auto MemberParents = Ctx.getParents(*Member); + assert(MemberParents.size() == 1); + const CallExpr *Call = MemberParents[0].get<CallExpr>(); ---------------- EugeneZelenko wrote:
```suggestion const auto *Call = MemberParents[0].get<CallExpr>(); ``` https://github.com/llvm/llvm-project/pull/94362 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits