[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] Recognize mutableCopy from literal as +1 (PR #132350)

Rashmi Mudduluru via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 8 15:08:01 PDT 2025


================
@@ -97,3 +97,13 @@ void create_member_init() {
 RetainPtr<id> return_bridge_cast() {
   return bridge_cast<CFArrayRef, NSArray>(create_cf_array());
 }
+
+void mutable_copy() {
+  RetainPtr<NSMutableDictionary> mutableArray = adoptNS(@{
+    @"Content-Type": @"text/html",
+  }.mutableCopy);
+}
+
+void string_copy(NSString *str) {
+  RetainPtr<NSString> copy = adoptNS(str.copy);
+}
----------------
t-rasmud wrote:

Can we also add a test for `RetainPtr<NSMutableDictionary>`?

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


More information about the cfe-commits mailing list