[cfe-commits] r150891 - /cfe/trunk/test/Analysis/misc-ps-region-store.mm

Ted Kremenek kremenek at apple.com
Sat Feb 18 13:27:25 PST 2012


Author: kremenek
Date: Sat Feb 18 15:27:25 2012
New Revision: 150891

URL: http://llvm.org/viewvc/llvm-project?rev=150891&view=rev
Log:
Add analyzer test for using of C++ references with ObjC object pointers, reported in <rdar://problem/10569024>.

Modified:
    cfe/trunk/test/Analysis/misc-ps-region-store.mm

Modified: cfe/trunk/test/Analysis/misc-ps-region-store.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.mm?rev=150891&r1=150890&r2=150891&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-region-store.mm (original)
+++ cfe/trunk/test/Analysis/misc-ps-region-store.mm Sat Feb 18 15:27:25 2012
@@ -29,3 +29,20 @@
   return [p foo];
 }
 
+// Basic test of C++ references with Objective-C pointers.
+ at interface RDar10569024
+ at property(readonly) int x;
+ at end
+
+typedef RDar10569024* RDar10569024Ref;
+
+void rdar10569024_aux(RDar10569024Ref o);
+
+int rdar10569024(id p, id collection) {
+  for (id elem in collection) {
+    const RDar10569024Ref &o = (RDar10569024Ref) elem;
+    rdar10569024_aux(o); // no-warning
+    return o.x; // no-warning
+  }
+  return 0;
+}





More information about the cfe-commits mailing list