Only check DiagnosticsEngine::hasErrorOccurred, hasFatalErrorOccurred cannot be true without it.

This commit is contained in:
Frederich Munch 2017-02-02 17:31:36 -05:00 committed by sftnight
parent de62978dad
commit 097a4e3fbd

View File

@ -371,8 +371,11 @@ namespace cling {
//TODO: Make the enum orable.
EParseResult ParseResult = kSuccess;
if (Diags.hasErrorOccurred() || Diags.hasFatalErrorOccurred()
|| T->getIssuedDiags() == Transaction::kErrors) {
assert((Diags.hasFatalErrorOccurred() ? Diags.hasErrorOccurred() : true)
&& "Diags.hasFatalErrorOccurred without Diags.hasErrorOccurred !");
if (Diags.hasErrorOccurred() || T->getIssuedDiags() == Transaction::kErrors)
{
T->setIssuedDiags(Transaction::kErrors);
ParseResult = kFailed;
} else if (Diags.getNumWarnings() > 0) {