Skip to content

Commit be95ed6

Browse files
committed
issue doxygen#7522 Source code browser does not distinguish between same-named functions
Prefer the local file definition in case of multiple definitions
1 parent c661656 commit be95ed6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/fortrancode.l

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,7 @@ static MemberDef *getFortranDefs(yyscan_t yyscanner,const QCString &memberName,
11711171
const UseMap &useMap)
11721172
{
11731173
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1174+
MemberDef *potentialMd = nullptr;
11741175
if (memberName.isEmpty()) return nullptr; /* empty name => nothing to link */
11751176

11761177
// look in local variables
@@ -1212,7 +1213,8 @@ static MemberDef *getFortranDefs(yyscan_t yyscanner,const QCString &memberName,
12121213
{ // found function in global scope
12131214
if (cd == nullptr)
12141215
{ // Skip if bound to type
1215-
return md.get();
1216+
if (md.get()->getOutputFileBase() == yyextra->sourceFileDef->getOutputFileBase()) return md.get();
1217+
else if (!potentialMd) potentialMd = md.get();
12161218
}
12171219
}
12181220
else if (moduleName == nspace->name())
@@ -1248,7 +1250,7 @@ static MemberDef *getFortranDefs(yyscan_t yyscanner,const QCString &memberName,
12481250
} // if linkable
12491251
} // for
12501252
}
1251-
return nullptr;
1253+
return potentialMd;
12521254
}
12531255

12541256
/**

0 commit comments

Comments
 (0)