-added warning case to cl compiler

-modified warning msg
This commit is contained in:
LianaHus 2015-09-30 14:03:30 +02:00
parent b2fa457327
commit 2706846f43
2 changed files with 6 additions and 2 deletions

View File

@ -457,7 +457,7 @@ bool TypeChecker::visit(VariableDeclaration const& _variable)
auto err = make_shared<Warning>();
*err <<
errinfo_sourceLocation(_variable.location()) <<
errinfo_comment("Uninitialized storage pointer. Did you mean '" + varType->toString(true) + " memory'?");
errinfo_comment("Uninitialized storage pointer. Did you mean '<type> memory " + _variable.name() + "'?");
m_errors.push_back(err);
}
}

View File

@ -494,7 +494,11 @@ bool CommandLineInterface::processInput()
if (!m_compiler->compile(optimize, runs))
{
for (auto const& error: m_compiler->errors())
SourceReferenceFormatter::printExceptionInformation(cerr, *error, "Error", *m_compiler);
SourceReferenceFormatter::printExceptionInformation(
cerr,
*error,
(dynamic_pointer_cast<Warning const>(error)) ? "Warning" : "Error", *m_compiler
);
return false;
}
m_compiler->link(m_libraries);