Fix issue with using declarations

This commit is contained in:
Jonathan Müller 2017-04-19 17:16:18 +02:00
commit 455af67837
2 changed files with 4 additions and 1 deletions

View file

@ -174,7 +174,7 @@ namespace
auto loc = source_location::make_file(path); // line number won't help
auto text = detail::cxstring(clang_getDiagnosticSpelling(diag));
logger.log("libclang parser", diagnostic{text.c_str(), loc, sev.value()});
logger.log("libclang", diagnostic{text.c_str(), loc, sev.value()});
}
}
}

View file

@ -131,12 +131,15 @@ namespace
std::vector<cpp_entity_id> result;
detail::visit_children(cur,
[&](const CXCursor& child) {
if (!result.empty())
return;
switch (clang_getCursorKind(child))
{
case CXCursor_TypeRef:
case CXCursor_TemplateRef:
case CXCursor_MemberRef:
case CXCursor_VariableRef:
case CXCursor_DeclRefExpr:
{
auto referenced = clang_getCursorReferenced(child);
result.push_back(detail::get_entity_id(referenced));