@@ -30,7 +30,10 @@ static void
3030populateParentNamespaces (llvm::SmallVector<Reference, 4 > &Namespaces,
3131 const T *D, bool &IsAnonymousNamespace);
3232
33- static void populateMemberTypeInfo (MemberTypeInfo &I, const FieldDecl *D);
33+ static void populateMemberTypeInfo (MemberTypeInfo &I, const Decl *D);
34+ static void populateMemberTypeInfo (RecordInfo &I, AccessSpecifier &Access,
35+ const DeclaratorDecl *D,
36+ bool IsStatic = false );
3437
3538// A function to extract the appropriate relative path for a given info's
3639// documentation. The path returned is a composite of the parent namespaces.
@@ -378,15 +381,19 @@ static void parseFields(RecordInfo &I, const RecordDecl *D, bool PublicOnly,
378381 for (const FieldDecl *F : D->fields ()) {
379382 if (!shouldSerializeInfo (PublicOnly, /* IsInAnonymousNamespace=*/ false , F))
380383 continue ;
384+ populateMemberTypeInfo (I, Access, F);
385+ }
386+ const auto *CxxRD = dyn_cast<CXXRecordDecl>(D);
387+ if (!CxxRD)
388+ return ;
389+ for (Decl *CxxDecl : CxxRD->decls ()) {
390+ auto *VD = dyn_cast<VarDecl>(CxxDecl);
391+ if (!VD ||
392+ !shouldSerializeInfo (PublicOnly, /* IsInAnonymousNamespace=*/ false , VD))
393+ continue ;
381394
382- auto &LO = F->getLangOpts ();
383- // Use getAccessUnsafe so that we just get the default AS_none if it's not
384- // valid, as opposed to an assert.
385- MemberTypeInfo &NewMember = I.Members .emplace_back (
386- getTypeInfoForType (F->getTypeSourceInfo ()->getType (), LO),
387- F->getNameAsString (),
388- getFinalAccessSpecifier (Access, F->getAccessUnsafe ()));
389- populateMemberTypeInfo (NewMember, F);
395+ if (VD->isStaticDataMember ())
396+ populateMemberTypeInfo (I, Access, VD, /* IsStatic=*/ true );
390397 }
391398}
392399
@@ -568,7 +575,7 @@ static void populateFunctionInfo(FunctionInfo &I, const FunctionDecl *D,
568575 }
569576}
570577
571- static void populateMemberTypeInfo (MemberTypeInfo &I, const FieldDecl *D) {
578+ static void populateMemberTypeInfo (MemberTypeInfo &I, const Decl *D) {
572579 assert (D && " Expect non-null FieldDecl in populateMemberTypeInfo" );
573580
574581 ASTContext& Context = D->getASTContext ();
@@ -585,6 +592,17 @@ static void populateMemberTypeInfo(MemberTypeInfo &I, const FieldDecl *D) {
585592 }
586593}
587594
595+ static void populateMemberTypeInfo (RecordInfo &I, AccessSpecifier &Access,
596+ const DeclaratorDecl *D, bool IsStatic) {
597+ // Use getAccessUnsafe so that we just get the default AS_none if it's not
598+ // valid, as opposed to an assert.
599+ MemberTypeInfo &NewMember = I.Members .emplace_back (
600+ getTypeInfoForType (D->getTypeSourceInfo ()->getType (), D->getLangOpts ()),
601+ D->getNameAsString (),
602+ getFinalAccessSpecifier (Access, D->getAccessUnsafe ()), IsStatic);
603+ populateMemberTypeInfo (NewMember, D);
604+ }
605+
588606static void
589607parseBases (RecordInfo &I, const CXXRecordDecl *D, bool IsFileInRootDir,
590608 bool PublicOnly, bool IsParent,
@@ -619,6 +637,7 @@ parseBases(RecordInfo &I, const CXXRecordDecl *D, bool IsFileInRootDir,
619637 continue ;
620638 FunctionInfo FI;
621639 FI.IsMethod = true ;
640+ FI.IsStatic = MD->isStatic ();
622641 // The seventh arg in populateFunctionInfo is a boolean passed by
623642 // reference, its value is not relevant in here so it's not used
624643 // anywhere besides the function call.
@@ -702,7 +721,7 @@ emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber,
702721 dyn_cast<ClassTemplatePartialSpecializationDecl *>(SpecOf))
703722 Specialization.SpecializationOf = getUSRForDecl (CTPSD);
704723
705- // Parameters to the specilization . For partial specializations, get the
724+ // Parameters to the specialization . For partial specializations, get the
706725 // parameters "as written" from the ClassTemplatePartialSpecializationDecl
707726 // because the non-explicit template parameters will have generated internal
708727 // placeholder names rather than the names the user typed that match the
@@ -755,6 +774,7 @@ emitInfo(const CXXMethodDecl *D, const FullComment *FC, int LineNumber,
755774 return {};
756775
757776 Func.IsMethod = true ;
777+ Func.IsStatic = D->isStatic ();
758778
759779 const NamedDecl *Parent = nullptr ;
760780 if (const auto *SD =
0 commit comments