Add line numbers to diagnostics

This commit is contained in:
Jonathan Müller 2017-10-10 17:16:10 +02:00
commit d088b44db6
3 changed files with 14 additions and 5 deletions

View file

@ -19,7 +19,13 @@ namespace cppast
{
inline source_location make_location(const CXCursor& cur)
{
return source_location::make_entity(get_display_name(cur).c_str());
auto loc = clang_getCursorLocation(cur);
CXString file;
unsigned line;
clang_getPresumedLocation(loc, &file, &line, nullptr);
return source_location::make_file(cxstring(file).c_str(), line);
}
inline source_location make_location(const CXType& type)