property-dot syntax is used on an object whose
capture causes retain cycle. // rdar://
11702054
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163017
91177308-0d34-0410-b5e6-
96231b3b80d8
if (block->getBlockDecl()->capturesVariable(Variable))
Visit(block->getBlockDecl()->getBody());
}
+
+ void VisitOpaqueValueExpr(OpaqueValueExpr *OVE) {
+ if (Capturer) return;
+ if (OVE->getSourceExpr())
+ Visit(OVE->getSourceExpr());
+ }
};
}
[weakx addBlock: ^{ [x actNow]; }];
[weakx setBlock: ^{ [x actNow]; }];
weakx.block = ^{ [x actNow]; };
+
+ // rdar://11702054
+ x.block = ^{ (void)x.actNow; }; // expected-warning {{capturing 'x' strongly in this block is likely to lead to a retain cycle}} \
+ // expected-note {{block will be retained by the captured object}}
}
@interface BlockOwner