if (const RetainSummary *S = getSummaryForOSObject(FD, FName, RetTy))
return S;
- if (TrackObjCAndCFObjects)
- if (const RetainSummary *S =
- getSummaryForObjCOrCFObject(FD, FName, RetTy, FT, AllowAnnotations))
- return S;
-
if (const auto *MD = dyn_cast<CXXMethodDecl>(FD))
- if (!(TrackOSObjects && isOSObjectRelated(MD)))
+ if (!isOSObjectRelated(MD))
return getPersistentSummary(RetEffect::MakeNoRet(),
ArgEffects(AF.getEmptyMap()),
ArgEffect(DoNothing),
ArgEffect(StopTracking),
ArgEffect(DoNothing));
+ if (TrackObjCAndCFObjects)
+ if (const RetainSummary *S =
+ getSummaryForObjCOrCFObject(FD, FName, RetTy, FT, AllowAnnotations))
+ return S;
+
return getDefaultSummary();
}
void* x = IOBSDNameMatching(); // no-warning
}
-
namespace member_CFRetains {
class Foo {
public:
foo.CFRetain(0); // no-warning
}
}
+
+namespace cxx_method_escaping {
+
+struct S {
+ static CFArrayRef testGetNoTracking();
+ CFArrayRef testGetNoTrackingMember();
+};
+
+void test_cxx_static_method_escaping() {
+ CFArrayRef arr = S::testGetNoTracking();
+ CFRelease(arr);
+}
+
+void test_cxx_method_escaping(S *s) {
+ CFArrayRef arr = s->testGetNoTrackingMember();
+ CFRelease(arr);
+}
+
+}