Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaLambda.cpp
Show First 20 Lines • Show All 774 Lines • ▼ Show 20 Lines | if (Context.getCanonicalFunctionResultType(ReturnType) == | ||||
auto BlockNullability = CSI.ReturnType->getNullability(Ctx); | auto BlockNullability = CSI.ReturnType->getNullability(Ctx); | ||||
if (BlockNullability && | if (BlockNullability && | ||||
(!RetTyNullability || | (!RetTyNullability || | ||||
hasWeakerNullability(*RetTyNullability, *BlockNullability))) | hasWeakerNullability(*RetTyNullability, *BlockNullability))) | ||||
CSI.ReturnType = ReturnType; | CSI.ReturnType = ReturnType; | ||||
continue; | continue; | ||||
} | } | ||||
if (isa_and_nonnull<InitListExpr>(RetE)) | |||||
continue; // Should have been diagnosed already, type is bogus. | |||||
// FIXME: This is a poor diagnostic for ReturnStmts without expressions. | // FIXME: This is a poor diagnostic for ReturnStmts without expressions. | ||||
// TODO: It's possible that the *first* return is the divergent one. | // TODO: It's possible that the *first* return is the divergent one. | ||||
Diag(RS->getBeginLoc(), | Diag(RS->getBeginLoc(), | ||||
diag::err_typecheck_missing_return_type_incompatible) | diag::err_typecheck_missing_return_type_incompatible) | ||||
<< ReturnType << CSI.ReturnType << isa<LambdaScopeInfo>(CSI); | << ReturnType << CSI.ReturnType << isa<LambdaScopeInfo>(CSI); | ||||
// Continue iterating so that we keep emitting diagnostics. | // Continue iterating so that we keep emitting diagnostics. | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,245 Lines • Show Last 20 Lines |