Include semicolon in unexposed entity

This commit is contained in:
Jonathan Müller 2017-10-10 22:33:03 +02:00
commit e53fc5e231
2 changed files with 7 additions and 2 deletions

View file

@ -223,9 +223,15 @@ namespace
|| clang_isExpression(kind) || kind == CXCursor_CXXBaseSpecifier
|| kind == CXCursor_TemplateTypeParameter
#endif
)
)
// need to shrink range by one
end = get_next_location(tu, file, end, -1);
else if (kind == CXCursor_UnexposedDecl)
{
// include semicolon, if necessary
if (token_after_is(tu, file, cur, end, ";"))
end = get_next_location(tu, file, end);
}
return clang_getRange(begin, end);
}

View file

@ -6,7 +6,6 @@
#include <cppast/cpp_member_variable.hpp>
#include <cppast/cpp_variable.hpp>
#include <clang-c/Index.h>
#include "libclang_visitor.hpp"