summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-10-06 23:12:58 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-10-06 23:12:58 +0000
commite15a370084f376be480072c06ebd94bbeac6663c (patch)
tree5a79c7727030f2d2a616bf9e0f3b25d62ca2fe10 /clang/lib/Sema/SemaExprCXX.cpp
parent9675de5ba826f4af74a6704fc0fe2c83262d5e4a (diff)
downloadbcm5719-llvm-e15a370084f376be480072c06ebd94bbeac6663c.tar.gz
bcm5719-llvm-e15a370084f376be480072c06ebd94bbeac6663c.zip
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. llvm-svn: 283508
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 8d20ac2a5d8..ad102f8d203 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -3320,6 +3320,10 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
llvm_unreachable("Cannot perform an ellipsis conversion");
case ImplicitConversionSequence::BadConversion:
+ bool Diagnosed =
+ DiagnoseAssignmentResult(Incompatible, From->getExprLoc(), ToType,
+ From->getType(), From, Action);
+ assert(Diagnosed && "failed to diagnose bad conversion"); (void)Diagnosed;
return ExprError();
}
OpenPOWER on IntegriCloud