summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-10-10 16:43:06 +0000
committerJordan Rose <jordan_rose@apple.com>2012-10-10 16:43:06 +0000
commite723a27ffebe0f62d647c60eb8d71bd554631473 (patch)
tree622889f771daee1da92e33b4df89ed0e69e45775 /clang/test
parent2bd991a1c09a94c76c8e38fa32e57ad7a9b111c8 (diff)
downloadbcm5719-llvm-e723a27ffebe0f62d647c60eb8d71bd554631473.tar.gz
bcm5719-llvm-e723a27ffebe0f62d647c60eb8d71bd554631473.zip
-Warc-repeated-use-of-weak: look through explicit casts on assigned values.
Reading from a weak property, casting the result, and assigning to a strong pointer should still be considered safe. llvm-svn: 165629
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaObjC/arc-repeated-weak.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/arc-repeated-weak.mm b/clang/test/SemaObjC/arc-repeated-weak.mm
index 90ba75f6efd..1c6578ef131 100644
--- a/clang/test/SemaObjC/arc-repeated-weak.mm
+++ b/clang/test/SemaObjC/arc-repeated-weak.mm
@@ -147,6 +147,17 @@ void testBlock(Test *a) {
});
}
+void assignToStrongWithCasts(Test *a) {
+ if (condition()) {
+ Test *val = (Test *)a.weakProp; // no-warning
+ (void)val;
+ } else {
+ id val;
+ val = (Test *)a.weakProp; // no-warning
+ (void)val;
+ }
+}
+
@interface Test (Methods)
@end
OpenPOWER on IntegriCloud