diff options
author | Douglas Gregor <dgregor@apple.com> | 2015-06-19 23:17:51 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2015-06-19 23:17:51 +0000 |
commit | 9960a8638d9ce37f0404e60b2387dadb12a07f77 (patch) | |
tree | 5bb56029051bcf69b685a9c534f6a46b8590f0bb /clang/test/Analysis/retain-release.m | |
parent | eb6e64ca8fd72725153fc25914f94a771d9c8572 (diff) | |
download | bcm5719-llvm-9960a8638d9ce37f0404e60b2387dadb12a07f77.tar.gz bcm5719-llvm-9960a8638d9ce37f0404e60b2387dadb12a07f77.zip |
CF_RETURNS_[NOT_]RETAINED on a param makes the inner pointer __nullable.
That is,
void cf2(CFTypeRef * __nullable p CF_RETURNS_NOT_RETAINED);
is equivalent to
void cf2(CFTypeRef __nullable * __nullable p CF_RETURNS_NOT_RETAINED);
More rdar://problem/18742441
llvm-svn: 240186
Diffstat (limited to 'clang/test/Analysis/retain-release.m')
-rw-r--r-- | clang/test/Analysis/retain-release.m | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Analysis/retain-release.m b/clang/test/Analysis/retain-release.m index e3ad4090373..1dbcda507c1 100644 --- a/clang/test/Analysis/retain-release.m +++ b/clang/test/Analysis/retain-release.m @@ -2164,6 +2164,13 @@ void testCFReturnsNotRetained() { CFRelease(obj); // // expected-warning {{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}} } +void testCFReturnsNotRetainedAnnotated() { + extern void getViaParam2(CFTypeRef * __nonnull CF_RETURNS_NOT_RETAINED outObj); + CFTypeRef obj; + getViaParam2(&obj); + CFRelease(obj); // // expected-warning {{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}} +} + void testCFReturnsRetained() { extern int copyViaParam(CFTypeRef * CF_RETURNS_RETAINED outObj); CFTypeRef obj; |