"%select{none|const|restrict|const and restrict|volatile|const and volatile|"
"volatile and restrict|const, volatile, and restrict}6)}4">;
def err_typecheck_missing_return_type_incompatible : Error<
- "return type %0 must match previous return type %1 when block"
- " literal has unspecified explicit return type">;
+ "return type %0 must match previous return type %1 when %select{block "
+ "literal|lambda expression}2 has unspecified explicit return type">;
def warn_incompatible_qualified_id : Warning<
"%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
!CurCap->ReturnType->isDependentType() &&
!ReturnT->isDependentType() &&
!Context.hasSameType(ReturnT, CurCap->ReturnType)) {
- // FIXME: Adapt diagnostic for lambdas.
Diag(ReturnLoc, diag::err_typecheck_missing_return_type_incompatible)
- << ReturnT << CurCap->ReturnType;
+ << ReturnT << CurCap->ReturnType
+ << getCurLambda() != 0;
return StmtError();
}
CurCap->ReturnType = ReturnT;
return [x](int y) { // expected-warning{{omitted result type}}
if (y > 0)
return X();
- else // FIXME: shouldn't mention blocks
- return x; // expected-error{{return type 'const X' must match previous return type 'X' when block literal has unspecified explicit return type}}
+ else
+ return x; // expected-error{{return type 'const X' must match previous return type 'X' when lambda expression has unspecified explicit return type}}
}(5);
}