Skip to content

Commit

Permalink
issue #10846 Unable to document default argument on friend functions
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed May 12, 2024
1 parent 5eac8f7 commit 7d37919
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/doxygen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3753,7 +3753,7 @@ static void findFriends()
mmd->name(),mmd->isFriend(),mmd->isRelated(),mmd->isFunction());
const ArgumentList &mmdAl = mmd->argumentList();
const ArgumentList &fmdAl = fmd->argumentList();
mergeArguments(const_cast<ArgumentList&>(mmdAl),const_cast<ArgumentList&>(fmdAl));
mergeArguments(const_cast<ArgumentList&>(fmdAl),const_cast<ArgumentList&>(mmdAl));
if (!fmd->documentation().isEmpty())
{
mmd->setDocumentation(fmd->documentation(),fmd->docFile(),fmd->docLine());
Expand Down
10 changes: 8 additions & 2 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1997,8 +1997,8 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons
// pre: the types of the arguments in the list should match.
void mergeArguments(ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwrite)
{
//printf("mergeArguments '%s', '%s'\n",
// qPrint(argListToString(srcAl)),qPrint(argListToString(dstAl)));
AUTO_TRACE("srcAl='{}',dstAl='{}',forceNameOverwrite={}",
qPrint(argListToString(srcAl)),qPrint(argListToString(dstAl)),forceNameOverwrite);

if (srcAl.size()!=dstAl.size())
{
Expand All @@ -2012,6 +2012,9 @@ void mergeArguments(ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwr
Argument &srcA = *srcIt;
Argument &dstA = *dstIt;

AUTO_TRACE_ADD("before merge: src=[type='{}',name='{}',def='{}'] dst=[type='{}',name='{}',def='{}']",
srcA.type,srcA.name,srcA.defval,
dstA.type,dstA.name,dstA.defval);
if (srcA.defval.isEmpty() && !dstA.defval.isEmpty())
{
//printf("Defval changing '%s'->'%s'\n",qPrint(srcA.defval),qPrint(dstA.defval));
Expand Down Expand Up @@ -2128,6 +2131,9 @@ void mergeArguments(ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwr
// qPrint(dstA.type), qPrint(dstA.name));
++srcIt;
++dstIt;
AUTO_TRACE_ADD("after merge: src=[type='{}',name='{}',def='{}'] dst=[type='{}',name='{}',def='{}']",
srcA.type,srcA.name,srcA.defval,
dstA.type,dstA.name,dstA.defval);
}
}

Expand Down

0 comments on commit 7d37919

Please sign in to comment.