Skip to content

Commit

Permalink
bug_365053 Wrong reference to ::classname
Browse files Browse the repository at this point in the history
Identified few places where the global class prefix (`::`) was not handled.
  • Loading branch information
albert-github committed Dec 15, 2021
1 parent 644607d commit 04a13d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/code.l
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
yyextra->code->codify(yytext);
endFontClass(yyscanner);
}
<MemberCall2,FuncCall>{ID}(({B}*"<"[^\n\[\](){}<>]*">")?({B}*"::"{B}*{ID})?)* {
<MemberCall2,FuncCall>("::")?{ID}(({B}*"<"[^\n\[\](){}<>]*">")?({B}*"::"{B}*{ID})?)* {
if (isCastKeyword(yytext))
{
REJECT;
Expand Down
7 changes: 4 additions & 3 deletions src/symbolresolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,14 +1041,15 @@ const ClassDef *SymbolResolver::resolveClass(const Definition *scope,
(scope->definitionType()!=Definition::TypeClass &&
scope->definitionType()!=Definition::TypeNamespace
) ||
(name.stripWhiteSpace().startsWith("::")) ||
(scope->getLanguage()==SrcLangExt_Java && QCString(name).find("::")!=-1)
)
{
scope=Doxygen::globalScope;
}
//fprintf(stderr,"------------ resolveClass(scope=%s,name=%s,mayUnlinkable=%d)\n",
// scope?qPrint(scope->name()):"<global>",
// name,
// qPrint(name),
// mayBeUnlinkable
// );
const ClassDef *result;
Expand All @@ -1070,12 +1071,12 @@ const ClassDef *SymbolResolver::resolveClass(const Definition *scope,
{
if (!mayBeHidden || !result->isHidden())
{
//printf("result was %s\n",result?qPrint(result->name()):"<none>");
//fprintf(stderr,"result was %s\n",result?qPrint(result->name()):"<none>");
result=0; // don't link to artificial/hidden classes unless explicitly allowed
}
}
//fprintf(stderr,"ResolvedClass(%s,%s)=%s\n",scope?qPrint(scope->name()):"<global>",
// name,result?qPrint(result->name()):"<none>");
// qPrint(name),result?qPrint(result->name()):"<none>");
return result;
}

Expand Down
4 changes: 2 additions & 2 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,12 +889,12 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
bool keepSpaces,int indentLevel)
{
if (text.isEmpty()) return;
//printf("linkify='%s'\n",text);
//printf("linkify='%s'\n",qPrint(text));
std::string txtStr=text.str();
size_t strLen = txtStr.length();
if (strLen==0) return;

static const reg::Ex regExp(R"(\a[\w~!\\.:$]*)");
static const reg::Ex regExp(R"(:?:?\a[\w~!\\.:$]*)");
reg::Iterator it(txtStr,regExp);
reg::Iterator end;

Expand Down

0 comments on commit 04a13d3

Please sign in to comment.