From: Ted Kremenek Date: Sat, 18 Feb 2012 21:27:25 +0000 (+0000) Subject: Add analyzer test for using of C++ references with ObjC object pointers, reported... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5550a2f4d5493864d1b80ec64b72ee59cfdccdac;p=clang Add analyzer test for using of C++ references with ObjC object pointers, reported in . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150891 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/misc-ps-region-store.mm b/test/Analysis/misc-ps-region-store.mm index fee9433dac..8615c6a9c7 100644 --- a/test/Analysis/misc-ps-region-store.mm +++ b/test/Analysis/misc-ps-region-store.mm @@ -29,3 +29,20 @@ char Test1_harness_b(Test1 *p) { return [p foo]; } +// Basic test of C++ references with Objective-C pointers. +@interface RDar10569024 +@property(readonly) int x; +@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; +}