diff options
author | John McCall <rjmccall@apple.com> | 2013-03-19 07:04:25 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2013-03-19 07:04:25 +0000 |
commit | 7cca821e1acf0f1b4fe892c3111bfb2086832e4e (patch) | |
tree | 52d32c5d35d69267c5b5ea16f7e5e6e89a55c6fb /lib/Sema/SemaExpr.cpp | |
parent | a5a3e01c504c00b1860286540090695ec0167531 (diff) |
Add a clarifying note when a return statement is rejected because
we expect a related result type.
rdar://12493140
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index bf4632c7bf..e4323c35a6 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -10039,6 +10039,9 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy, if (CheckInferredResultType) EmitRelatedResultTypeNote(SrcExpr); + + if (Action == AA_Returning && ConvTy == IncompatiblePointer) + EmitRelatedResultTypeNoteForReturn(DstType); if (Complained) *Complained = true; |