]> granicus.if.org Git - clang/commitdiff
Correctly handle 'Class<...>' when examining Cocoa conventions in the static analyzer...
authorTed Kremenek <kremenek@apple.com>
Thu, 5 Aug 2010 00:19:24 +0000 (00:19 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 5 Aug 2010 00:19:24 +0000 (00:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110289 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/CocoaConventions.cpp
test/Analysis/retain-release.m

index 3ba887ccc7e37d06dd1f05e78d1686242d2e5bc5..b446a048d4888945db80b30cd070f21e204bb657 100644 (file)
@@ -173,9 +173,10 @@ bool cocoa::isCocoaObjectRef(QualType Ty) {
   if (!PT)
     return true;
   
-  // We assume that id<..>, id, and "Class" all represent tracked objects.
+  // We assume that id<..>, id, Class, and Class<..> all represent tracked
+  // objects.
   if (PT->isObjCIdType() || PT->isObjCQualifiedIdType() ||
-      PT->isObjCClassType())
+      PT->isObjCClassType() || PT->isObjCQualifiedClassType())
     return true;
   
   // Does the interface subclass NSObject?
index c9c7d271347b193098b39fa5e05b2225d6dbc3ec..064165aaf9e1e34c7e83328ba1931eadaeee33bc 100644 (file)
@@ -1358,3 +1358,12 @@ void test_blocks_1_indirect_retain_via_call(void) {
 }
 @end
 
+// <rdar://problem/8272168> - Correcly handle Class<...> in Cocoa Conventions
+// detector.
+
+@protocol Prot_R8272168 @end
+Class <Prot_R8272168> GetAClassThatImplementsProt_R8272168();
+void r8272168() {
+  GetAClassThatImplementsProt_R8272168();
+}
+