blocks's argument in the inner block requires special treatment.
Fixes radar
7692419.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97244
91177308-0d34-0410-b5e6-
96231b3b80d8
if (BlockDeclRefExpr *CDRE = dyn_cast<BlockDeclRefExpr>(S))
if (!isa<FunctionDecl>(CDRE->getDecl()) &&
!CDRE->isByRef() &&
+ !isa<ParmVarDecl>(CDRE->getDecl()) &&
!InnerBlockValueDecls.count(CDRE->getDecl())) {
InnerBlockValueDecls.insert(CDRE->getDecl());
InnerBlockDeclRefs.push_back(CDRE);
});
});
}
+
+// radar 7692419
+@interface Bar
+@end
+
+void f(Bar *);
+void q(void (^block)(void));
+
+void x() {
+ void (^myblock)(Bar *b) = ^(Bar *b) {
+ q(^{
+ f(b);
+ });
+ };
+
+ Bar *b = (Bar *)42;
+ myblock(b);
+}