diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-10-06 23:12:58 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-10-06 23:12:58 +0000 |
commit | 575e6c8350368d9e7c78e4f52eae9de593c177cf (patch) | |
tree | de5313155e0e410f9faaaaaea31e54ee74c7c0ea /lib/Sema/SemaPseudoObject.cpp | |
parent | 58bc87db44064581cc3bef95c71674265a9bcaf0 (diff) |
PR25890: Fix incoherent error handling in PerformImplicitConversion and
CheckSingleAssignmentConstraints. These no longer produce ExprError() when they
have not emitted an error, and reliably inform the caller when they *have*
emitted an error.
This fixes some serious issues where we would fail to emit any diagnostic for
invalid code and then attempt to emit code for an invalid AST, and conversely
some issues where we would emit two diagnostics for the same problem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaPseudoObject.cpp')
-rw-r--r-- | lib/Sema/SemaPseudoObject.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaPseudoObject.cpp b/lib/Sema/SemaPseudoObject.cpp index c93d800f96..a6140184cf 100644 --- a/lib/Sema/SemaPseudoObject.cpp +++ b/lib/Sema/SemaPseudoObject.cpp @@ -770,7 +770,8 @@ ExprResult ObjCPropertyOpBuilder::buildSet(Expr *op, SourceLocation opcLoc, ExprResult opResult = op; Sema::AssignConvertType assignResult = S.CheckSingleAssignmentConstraints(paramType, opResult); - if (S.DiagnoseAssignmentResult(assignResult, opcLoc, paramType, + if (opResult.isInvalid() || + S.DiagnoseAssignmentResult(assignResult, opcLoc, paramType, op->getType(), opResult.get(), Sema::AA_Assigning)) return ExprError(); |