if (!VD->hasLocalStorage()) {
if (Visited.insert(VD))
BEVals.push_back(VD, BC);
- } else if (DR->refersToEnclosingLocal()) {
- if (Visited.insert(VD) && IsTrackedDecl(VD))
- BEVals.push_back(VD, BC);
}
}
}
DeclVec *BV = (DeclVec*) A.Allocate<DeclVec>();
new (BV) DeclVec(BC, 10);
- // Find the referenced variables.
+ // Go through the capture list.
+ for (BlockDecl::capture_const_iterator CI = BD->capture_begin(),
+ CE = BD->capture_end(); CI != CE; ++CI) {
+ BV->push_back(CI->getVariable(), BC);
+ }
+
+ // Find the referenced global/static variables.
FindBlockDeclRefExprsVals F(*BV, BC);
F.Visit(BD->getBody());
}
-// FALSE POSITIVE <rdar://problem/12415065>
@interface rdar12415065 : NSObject
@end
if (!queue)
return;
- // FALSE POSITIVE
- // expected-warning@+1 {{Variable 'x' is uninitialized when captured by block}}
+ // This previously was a false positive with 'x' being flagged as being
+ // uninitialized when captured by the exterior block (when it is only
+ // captured by the interior block).
dispatch_async(queue, ^{
double x = 0.0;
if (24.0f < x) {