Specialize the diagnostic complaining about conflicting types of
return statements within a lambda; this diagnostic previously referred
to blocks.
llvm-svn: 150584
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index b47e3d2..4351e9b 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -1847,9 +1847,9 @@
!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;