}
assert(!FnRetType.isNull());
- if (BlockScopeInfo *CurBlock = dyn_cast<BlockScopeInfo>(CurCap)) {
- if (CurBlock->FunctionType->getAs<FunctionType>()->getNoReturnAttr()) {
+ if (auto *CurBlock = dyn_cast<BlockScopeInfo>(CurCap)) {
+ if (CurBlock->FunctionType->castAs<FunctionType>()->getNoReturnAttr()) {
Diag(ReturnLoc, diag::err_noreturn_block_has_return_expr);
return StmtError();
}
- } else if (CapturedRegionScopeInfo *CurRegion =
- dyn_cast<CapturedRegionScopeInfo>(CurCap)) {
+ } else if (auto *CurRegion = dyn_cast<CapturedRegionScopeInfo>(CurCap)) {
Diag(ReturnLoc, diag::err_return_in_captured_stmt) << CurRegion->getRegionName();
return StmtError();
} else {
assert(CurLambda && "unknown kind of captured scope");
- if (CurLambda->CallOperator->getType()->getAs<FunctionType>()
+ if (CurLambda->CallOperator->getType()
+ ->castAs<FunctionType>()
->getNoReturnAttr()) {
Diag(ReturnLoc, diag::err_noreturn_lambda_has_return_expr);
return StmtError();