[nullability] A call to a non-const operator should also be considered mutating.
The additional test in this patch fails without the fix.
PiperOrigin-RevId: 608879021
Change-Id: I295a03fefbf4c5041e693daa211f524138e33479
diff --git a/nullability/pointer_nullability_matchers.cc b/nullability/pointer_nullability_matchers.cc
index 47d26ce..854b68e 100644
--- a/nullability/pointer_nullability_matchers.cc
+++ b/nullability/pointer_nullability_matchers.cc
@@ -113,6 +113,10 @@
return cxxMemberCallExpr(callee(cxxMethodDecl(unless(isConst()))));
}
+Matcher<Stmt> isNonConstMemberOperatorCall() {
+ return cxxOperatorCallExpr(callee(cxxMethodDecl(unless(isConst()))));
+}
+
Matcher<Stmt> isSmartPointerGlValue() {
return expr(hasType(isSupportedSmartPointer()), isGLValue());
}