data: fixed indexer coverage

* revised the check if a declaration is implicit. this affects whether or not the reference to the decl should be recorded.
This commit is contained in:
malte_langkabel
2016-02-22 13:14:48 +01:00
parent 7847d53fbb
commit fc1a43c1a5
3 changed files with 27 additions and 5 deletions
+24 -4
View File
@@ -1076,15 +1076,35 @@ void ASTVisitor::RecordTypeRef(
}
}
bool ASTVisitor::isImpliciit(clang::Decl* d) const
{
if (!d)
{
return false;
}
if (clang::ClassTemplateSpecializationDecl* ctsd = clang::dyn_cast_or_null<clang::ClassTemplateSpecializationDecl>(d))
{
if (!ctsd->isExplicitSpecialization())
{
return true;
}
}
return isImpliciit(clang::dyn_cast_or_null<clang::Decl>(d->getDeclContext()));
}
void ASTVisitor::RecordDeclRef(
clang::NamedDecl *d,
clang::NamedDecl* d,
clang::SourceLocation beginLoc,
RefType refType,
SymbolType symbolType)
{
if ((!d) ||
(d->isImplicit() && !isLocatedInProjectFile(beginLoc)) ||
(!d->isImplicit() && !isLocatedInUnparsedProjectFile(beginLoc)))
bool isImplicit = isImpliciit(d);
if (!d ||
(isImplicit && !isLocatedInProjectFile(beginLoc)) ||
(!isImplicit && !isLocatedInUnparsedProjectFile(beginLoc)))
{
return;
}
@@ -287,6 +287,8 @@ private:
RefType refType,
SymbolType symbolType = ST_Max);
bool isImpliciit(clang::Decl* d) const;
void RecordDeclRef(
clang::NamedDecl *d,
clang::SourceLocation beginLoc,
@@ -116,7 +116,7 @@ std::shared_ptr<DataType> CxxTypeNameResolver::typeToDataType(const clang::Type*
CxxDeclNameResolver declNameResolver(tagType->getDecl(), getIgnoredContextDecls());
typeNameHerarchy = declNameResolver.getDeclNameHierarchy();
}
else // specialization of a template template parameter (no concrete class)
else // specialization of a template template parameter (no concrete class) important, may help: has no underlying decl!
{
const clang::TemplateSpecializationType* templateSpecializationType = type->getAs<clang::TemplateSpecializationType>();
CxxDeclNameResolver declNameResolver(templateSpecializationType->getTemplateName().getAsTemplateDecl(), getIgnoredContextDecls());