[nullability] Smart pointers: Implement `swap()`.
PiperOrigin-RevId: 589791458
Change-Id: I94e3a9ff67628cf9ab09835d7993a038ac84bf79
diff --git a/nullability/pointer_nullability_matchers.cc b/nullability/pointer_nullability_matchers.cc
index 78cf931..be1f31a 100644
--- a/nullability/pointer_nullability_matchers.cc
+++ b/nullability/pointer_nullability_matchers.cc
@@ -113,6 +113,13 @@
callee(cxxMethodDecl(hasName(Name))));
}
+Matcher<Stmt> isSmartPointerFreeSwapCall() {
+ return callExpr(callee(functionDecl(isInStdNamespace(), hasName("swap"))),
+ argumentCountIs(2),
+ hasArgument(0, hasType(isSupportedSmartPointer())),
+ hasArgument(1, hasType(isSupportedSmartPointer())));
+}
+
Matcher<Stmt> isSmartPointerFactoryCall() {
return callExpr(
hasType(isSupportedSmartPointer()),