ArrayRef<const sema::FunctionScopeInfo *> FunctionScopes,
VarDecl *VarToCapture, Sema &S) {
- const Optional<unsigned> FailDistance;
+ const Optional<unsigned> NoLambdaIsCaptureCapable;
const Optional<unsigned> OptionalStackIndex =
getStackIndexOfNearestEnclosingCaptureReadyLambda(FunctionScopes,
VarToCapture);
if (!OptionalStackIndex)
- return FailDistance;
+ return NoLambdaIsCaptureCapable;
const unsigned IndexOfCaptureReadyLambda = OptionalStackIndex.getValue();
assert(((IndexOfCaptureReadyLambda != (FunctionScopes.size() - 1)) ||
/*BuildAndDiagnose*/ false, CaptureType,
DeclRefType, &IndexOfCaptureReadyLambda);
if (!CanCaptureVariable)
- return FailDistance;
+ return NoLambdaIsCaptureCapable;
} else {
// Check if the capture-ready lambda can truly capture 'this' by checking
// whether all enclosing lambdas of the capture-ready lambda can capture
/*Explicit*/ false, /*BuildAndDiagnose*/ false,
&IndexOfCaptureReadyLambda);
if (!CanCaptureThis)
- return FailDistance;
+ return NoLambdaIsCaptureCapable;
}
return IndexOfCaptureReadyLambda;
}