[clang][ExtractAPI] Add support for C++ member templates

Visit and serialize C++ fields by checking if a var template's context is a CXXRecordDecl in VisitVarTemplateDecl.

Depends on D158027

Reviewed By: dang

Differential Revision: https://reviews.llvm.org/D158029
This commit is contained in:
Erick Velez
2023-08-21 09:06:53 -07:00
parent 0303137bfc
commit 634b2fd2ca
8 changed files with 308 additions and 11 deletions

View File

@@ -465,6 +465,11 @@ DeclarationFragmentsBuilder::getFragmentsForVarTemplate(const VarDecl *Var) {
? Var->getTypeSourceInfo()->getType()
: Var->getASTContext().getUnqualifiedObjCPointerType(Var->getType());
// Might be a member, so might be static.
if (Var->isStaticDataMember())
Fragments.append("static", DeclarationFragments::FragmentKind::Keyword)
.appendSpace();
DeclarationFragments After;
DeclarationFragments ArgumentFragment =
getFragmentsForType(T, Var->getASTContext(), After);