Skip to content

Commit 58cc4f3

Browse files
committed
issue #11569 Doxygen might generate invalid tag file, breaking downstream project documentation (no uniquely matching class member found for)
1 parent 95d4ef0 commit 58cc4f3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/classdef.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,8 +1325,7 @@ void ClassDefImpl::internalInsertMember(MemberDef *md,
13251325
// then we also need to insert the member in the template instance.
13261326
for (const auto &ti : getTemplateInstances())
13271327
{
1328-
//printf("member %s of class %s with template instance %s\n",qPrint(md->name()),qPrint(name()),
1329-
// qPrint(ti.templSpec));
1328+
AUTO_TRACE_ADD("member {} of class {} with template instance {}\n",md->name(),name(),ti.templSpec);
13301329
ClassDefMutable *cdm = toClassDefMutable(ti.classDef);
13311330
if (cdm)
13321331
{
@@ -4387,6 +4386,7 @@ ClassDef *ClassDefImpl::insertTemplateInstance(const QCString &fileName,
43874386

43884387
void ClassDefImpl::insertExplicitTemplateInstance(ClassDef *templateClass,const QCString &templSpec)
43894388
{
4389+
AUTO_TRACE("this={} cd={} templSpec={}",name(),templateClass->name(),templSpec);
43904390
m_templateInstances.emplace_back(templSpec,templateClass);
43914391
}
43924392

@@ -4404,9 +4404,9 @@ void ClassDefImpl::addMemberToTemplateInstance(const MemberDef *md,
44044404
const ArgumentList &templateArguments,
44054405
const QCString &templSpec)
44064406
{
4407+
AUTO_TRACE("this={} md={}",name(),md->name());
44074408
auto actualArguments_p = stringToArgumentList(getLanguage(),templSpec);
44084409
auto imd = md->createTemplateInstanceMember(templateArguments,actualArguments_p);
4409-
//printf("%s->setMemberClass(%p)\n",qPrint(imd->name()),this);
44104410
auto mmd = toMemberDefMutable(imd.get());
44114411
mmd->setMemberClass(this);
44124412
mmd->setTemplateMaster(md);
@@ -4428,6 +4428,7 @@ void ClassDefImpl::addMemberToTemplateInstance(const MemberDef *md,
44284428

44294429
void ClassDefImpl::addMembersToTemplateInstance(const ClassDef *cd,const ArgumentList &templateArguments,const QCString &templSpec)
44304430
{
4431+
AUTO_TRACE("this={} cd={} templSpec={}",name(),cd->name(),templSpec);
44314432
//printf("%s::addMembersToTemplateInstance(%s,%s)\n",qPrint(name()),qPrint(cd->name()),templSpec);
44324433
for (const auto &mni : cd->memberNameInfoLinkedMap())
44334434
{

src/doxygen.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5261,7 +5261,9 @@ static void makeTemplateInstanceRelation(const Entry *root,ClassDefMutable *cd)
52615261
{
52625262
AUTO_TRACE("root->name={} cd={}",root->name,cd->name());
52635263
int i = root->name.find('<');
5264-
if (i!=-1 && root->lang!=SrcLangExt::CSharp && root->lang!=SrcLangExt::Java)
5264+
int j = root->name.findRev('>');
5265+
int k = root->name.find("::",j+1); // A<T::B> => ok, A<T>::B => nok
5266+
if (i!=-1 && j!=-1 && k==-1 && root->lang!=SrcLangExt::CSharp && root->lang!=SrcLangExt::Java)
52655267
{
52665268
ClassDefMutable *master = getClassMutable(root->name.left(i));
52675269
if (master && master!=cd && !cd->templateMaster())

0 commit comments

Comments
 (0)