Skip to content

Commit 3849d3b

Browse files
committed
issue #5813 Protected inherited members not documented in derived class if protected functions in base class is not documented (Origin: bugzilla #751453)
1 parent 657295e commit 3849d3b

File tree

4 files changed

+22
-20
lines changed

4 files changed

+22
-20
lines changed

src/classdef.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4531,8 +4531,8 @@ int ClassDefImpl::countMembersIncludingGrouped(MemberListType lt,
45314531
count+=mg->countGroupedInheritedMembers(lt);
45324532
}
45334533
}
4534-
//printf("%s:countMembersIncludingGrouped(lt=%d,%s)=%d\n",
4535-
// qPrint(name()),lt,ml?qPrint(ml->listType().to_label()):"<none>",count);
4534+
//printf("%s:countMembersIncludingGrouped(lt=%s,%s)=%d\n",
4535+
// qPrint(name()),qPrint(lt.to_string()),ml?qPrint(ml->listType().toLabel()):"<none>",count);
45364536
return count;
45374537
}
45384538

@@ -4543,8 +4543,8 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,ClassDefSet &
45434543
{
45444544
int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE);
45454545
bool process = count>0;
4546-
//printf("%s: writeInheritedMemberDec: lt=%d process=%d invert=%d always=%d\n",
4547-
// qPrint(name()),lt,process,invert,showAlways);
4546+
//printf("%s: writeInheritedMemberDec: lt=%s process=%d invert=%d always=%d\n",
4547+
// qPrint(name()),qPrint(lt.to_string()),process,invert,showAlways);
45484548
if ((process^invert) || showAlways)
45494549
{
45504550
for (const auto &ibcd : m_impl->inherits)
@@ -4559,13 +4559,15 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,ClassDefSet &
45594559
{
45604560
lt2=lt3;
45614561
}
4562-
//printf("%s:convert %d->(%d,%d) prot=%d\n",qPrint(icd->name()),lt,lt1,lt2,ibcd->prot);
4562+
//printf("%s:convert %s->(%s,%s) prot=%d\n",qPrint(icd->name()),qPrint(lt.to_string()),
4563+
// qPrint(lt1.to_string()),qPrint(lt2.to_string()),ibcd.prot);
45634564
if (visitedClasses.find(icd)==visitedClasses.end())
45644565
{
45654566
visitedClasses.insert(icd); // guard for multiple virtual inheritance
45664567
if (!lt1.isInvalid())
45674568
{
4568-
icd->writeMemberDeclarations(ol,visitedClasses,static_cast<MemberListType>(lt1),
4569+
//printf("--> writeMemberDeclarations for type %s\n",qPrint(lt1.to_string()));
4570+
icd->writeMemberDeclarations(ol,visitedClasses,lt1,
45694571
title,QCString(),FALSE,inheritedFrom,lt2,FALSE,TRUE);
45704572
}
45714573
}
@@ -4583,7 +4585,7 @@ void ClassDefImpl::writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedCl
45834585
const QCString &subTitle,bool showInline,const ClassDef *inheritedFrom,MemberListType lt2,
45844586
bool invert,bool showAlways) const
45854587
{
4586-
//printf("%s: ClassDefImpl::writeMemberDeclarations lt=%d lt2=%d\n",qPrint(name()),lt,lt2);
4588+
//printf("%s: ClassDefImpl::writeMemberDeclarations lt=%s lt2=%s\n",qPrint(name()),qPrint(lt.to_string()),qPrint(lt2.to_string()));
45874589
MemberList * ml = getMemberList(lt);
45884590
MemberList * ml2 = getMemberList(lt2);
45894591
if (getLanguage()==SrcLangExt::VHDL) // use specific declarations function
@@ -4605,15 +4607,15 @@ void ClassDefImpl::writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedCl
46054607
QCString tt = title, st = subTitle;
46064608
if (ml)
46074609
{
4608-
//printf(" writeDeclaration type=%d count=%d\n",lt,ml->numDecMembers());
4609-
ml->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,FALSE,showInline,inheritedFrom,lt);
4610+
//printf(" writeDeclarations type=%s count=%d\n",qPrint(lt.to_string()),ml->numDecMembers());
4611+
ml->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,FALSE,showInline,inheritedFrom,lt,true);
46104612
tt.clear();
46114613
st.clear();
46124614
}
46134615
if (ml2)
46144616
{
4615-
//printf(" writeDeclaration type=%d count=%d\n",lt2,ml2->numDecMembers());
4616-
ml2->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,FALSE,showInline,inheritedFrom,lt);
4617+
//printf(" writeDeclarations type=%s count=%d\n",qPrint(lt2.to_string()),ml2->numDecMembers());
4618+
ml2->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,FALSE,showInline,inheritedFrom,lt,ml==nullptr);
46174619
}
46184620
bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
46194621
if (!inlineInheritedMembers) // show inherited members as separate lists

src/memberdef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
21852185
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
21862186
bool inGroup, int indentLevel, const ClassDef *inheritedFrom,const QCString &inheritId) const
21872187
{
2188-
//printf("> %s MemberDefImpl::writeDeclaration() inGroup=%d\n",qPrint(qualifiedName()),inGroup);
2188+
//printf("> %s MemberDefImpl::writeDeclaration() inGroup=%d inheritId=%s\n",qPrint(qualifiedName()),inGroup,qPrint(inheritId));
21892189

21902190
// hide enum value, since they appear already as part of the enum, unless they
21912191
// are explicitly grouped.

src/memberlist.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ void MemberList::writePlainDeclarations(OutputList &ol, bool inGroup,
354354
bool first=TRUE;
355355
for (const auto &md : m_members)
356356
{
357-
//printf(">>> Member '%s' type=%d visible=%d inheritedFrom=%p\n",
358-
// qPrint(md->name()),md->memberType(),md->isBriefSectionVisible(),(void*)inheritedFrom);
357+
//printf(">>> Member '%s' type=%d visible=%d inheritedFrom=%p inheritId=%s\n",
358+
// qPrint(md->name()),md->memberType(),md->isBriefSectionVisible(),(void*)inheritedFrom,qPrint(inheritId));
359359
if ((inheritedFrom==nullptr || !md->isReimplementedBy(inheritedFrom)) &&
360360
md->isBriefSectionVisible())
361361
{
@@ -505,11 +505,13 @@ void MemberList::writePlainDeclarations(OutputList &ol, bool inGroup,
505505
* given class as inherited members, parameter cd points to the
506506
* class containing the members.
507507
* @param lt Type of list that is inherited from.
508+
* @param showSectionTitle do we show the "additional members" header or not?
509+
* When combining public and protected inherited members under a single header only for the first list it should be shown
508510
*/
509511
void MemberList::writeDeclarations(OutputList &ol,
510512
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
511513
const QCString &title,const QCString &subtitle, bool showEnumValues,
512-
bool showInline,const ClassDef *inheritedFrom,MemberListType lt) const
514+
bool showInline,const ClassDef *inheritedFrom,MemberListType lt,bool showSectionTitle) const
513515
{
514516
(void)showEnumValues; // unused
515517

@@ -530,13 +532,11 @@ void MemberList::writeDeclarations(OutputList &ol,
530532
int numEnumValues = numDecEnumValues();
531533
if (inheritedFrom)
532534
{
533-
if ( cd && !optimizeVhdl &&
534-
cd->countMembersIncludingGrouped(m_listType,inheritedFrom,TRUE)>0
535-
)
535+
if (cd && !optimizeVhdl)
536536
{
537537
inheritId = substitute(lt.toLabel(),"-","_")+"_"+
538538
stripPath(cd->getOutputFileBase());
539-
if (!title.isEmpty())
539+
if (showSectionTitle && !title.isEmpty())
540540
{
541541
ol.writeInheritedSectionTitle(inheritId,cd->getReference(),
542542
cd->getOutputFileBase(),

src/memberlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class MemberList : public MemberVector
128128
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
129129
const QCString &title,const QCString &subtitle,
130130
bool showEnumValues=FALSE,bool showInline=FALSE,
131-
const ClassDef *inheritedFrom=nullptr,MemberListType lt=MemberListType::PubMethods()) const;
131+
const ClassDef *inheritedFrom=nullptr,MemberListType lt=MemberListType::PubMethods(),bool showSectionTitle=true) const;
132132
void writeDocumentation(OutputList &ol,const QCString &scopeName,
133133
const Definition *container,const QCString &title,
134134
bool showEnumValues=FALSE,bool showInline=FALSE) const;

0 commit comments

Comments
 (0)