Properly handle libclang diagnostics

This commit is contained in:
Jonathan Müller 2017-03-16 12:15:46 +01:00
commit db0e649bf6
7 changed files with 79 additions and 13 deletions

View file

@ -11,6 +11,13 @@
using namespace cppast;
bool diagnostic_logger::log(const char* source, const diagnostic& d) const
{
if (d.severity == severity::error)
error_ = true;
return do_log(source, d);
}
bool stderr_diagnostic_logger::do_log(const char* source, const diagnostic& d) const
{
std::fprintf(stderr, "[%s] [%s] %s %s\n", source, to_string(d.severity),