diff --git a/src/lib_parser/data/parser/cxx/ASTVisitor.cpp b/src/lib_parser/data/parser/cxx/ASTVisitor.cpp index 71bd9a75..76567659 100644 --- a/src/lib_parser/data/parser/cxx/ASTVisitor.cpp +++ b/src/lib_parser/data/parser/cxx/ASTVisitor.cpp @@ -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(d)) + { + if (!ctsd->isExplicitSpecialization()) + { + return true; + } + } + + return isImpliciit(clang::dyn_cast_or_null(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; } diff --git a/src/lib_parser/data/parser/cxx/ASTVisitor.h b/src/lib_parser/data/parser/cxx/ASTVisitor.h index 3a055f51..745a7a0c 100644 --- a/src/lib_parser/data/parser/cxx/ASTVisitor.h +++ b/src/lib_parser/data/parser/cxx/ASTVisitor.h @@ -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, diff --git a/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.cpp b/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.cpp index e1e5b27d..d8dfcb17 100644 --- a/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.cpp +++ b/src/lib_parser/data/parser/cxx/name_resolver/CxxTypeNameResolver.cpp @@ -116,7 +116,7 @@ std::shared_ptr 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(); CxxDeclNameResolver declNameResolver(templateSpecializationType->getTemplateName().getAsTemplateDecl(), getIgnoredContextDecls());