Skip to content

Commit

Permalink
issue #10760 Inherited template typedef does not extend template inst…
Browse files Browse the repository at this point in the history
…antiation
  • Loading branch information
doxygen committed Apr 13, 2024
1 parent 8dd9072 commit eb11063
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/memberdef.cpp
Expand Up @@ -4328,7 +4328,7 @@ void MemberDefImpl::setNamespace(NamespaceDef *nd)
std::unique_ptr<MemberDef> MemberDefImpl::createTemplateInstanceMember(
const ArgumentList &formalArgs,const std::unique_ptr<ArgumentList> &actualArgs) const
{
//printf(" Member %s %s %s\n",typeString(),qPrint(name()),argsString());
//printf(" Member %s %s %s\n",qPrint(typeString()),qPrint(name()),qPrint(argsString()));
std::unique_ptr<ArgumentList> actualArgList = std::make_unique<ArgumentList>(m_defArgList);
if (!m_defArgList.empty())
{
Expand Down
18 changes: 9 additions & 9 deletions src/util.cpp
Expand Up @@ -4672,12 +4672,12 @@ QCString substituteTemplateArgumentsInString(
const ArgumentList &formalArgs,
const ArgumentList *actualArgs)
{
//printf("substituteTemplateArgumentsInString(name=%s formal=%s actualArg=%s)\n",
//printf("> substituteTemplateArgumentsInString(name=%s formal=%s actualArg=%s)\n",
// qPrint(nm),qPrint(argListToString(formalArgs)),actualArgs ? qPrint(argListToString(*actualArgs)): "");
if (formalArgs.empty()) return nm;
QCString result;

static const reg::Ex re(R"(\a[\w:.]*)");
static const reg::Ex re(R"(\a\w*)");
std::string name = nm.str();
reg::Iterator it(name,re);
reg::Iterator end;
Expand All @@ -4695,6 +4695,7 @@ QCString substituteTemplateArgumentsInString(
{
actIt = actualArgs->begin();
}
//printf(": name=%s\n",qPrint(name));

// if n is a template argument, then we substitute it
// for its template instance argument.
Expand Down Expand Up @@ -4730,7 +4731,7 @@ QCString substituteTemplateArgumentsInString(
formArg.name += "...";
formArg.type = formArg.type.left(8)+formArg.type.mid(11);
}
//printf("n=%s formArg->type='%s' formArg->name='%s' formArg->defval='%s' actArg->type='%s' actArg->name='%s' \n",
//printf(": n=%s formArg->type='%s' formArg->name='%s' formArg->defval='%s' actArg->type='%s' actArg->name='%s' \n",
// qPrint(n),qPrint(formArg.type),qPrint(formArg.name),qPrint(formArg.defval),qPrint(actArg.type),qPrint(actArg.name));
if (formArg.type=="class" || formArg.type=="typename" || formArg.type.startsWith("template"))
{
Expand Down Expand Up @@ -4762,13 +4763,13 @@ QCString substituteTemplateArgumentsInString(
{
if (actArg.name.isEmpty())
{
result += actArg.type+" ";
result += actArg.type;
}
else
// for case where the actual arg is something like "unsigned int"
// the "int" part is in actArg->name.
{
result += actArg.type+" "+actArg.name+" ";
result += actArg.type+" "+actArg.name;
}
found=TRUE;
}
Expand All @@ -4779,7 +4780,7 @@ QCString substituteTemplateArgumentsInString(
formArg.defval!=nm /* to prevent recursion */
)
{
result += substituteTemplateArgumentsInString(formArg.defval,formalArgs,actualArgs)+" ";
result += substituteTemplateArgumentsInString(formArg.defval,formalArgs,actualArgs);
found=TRUE;
}
}
Expand All @@ -4789,7 +4790,7 @@ QCString substituteTemplateArgumentsInString(
formArg.defval!=nm /* to prevent recursion */
)
{
result += substituteTemplateArgumentsInString(formArg.defval,formalArgs,actualArgs)+" ";
result += substituteTemplateArgumentsInString(formArg.defval,formalArgs,actualArgs);
found=TRUE;
}
if (actualArgs && actIt!=actualArgs->end())
Expand All @@ -4805,8 +4806,7 @@ QCString substituteTemplateArgumentsInString(
}
result+=name.substr(p);
result=result.simplifyWhiteSpace();
//printf(" Inheritance relation %s -> %s\n",
// qPrint(name),qPrint(result));
//printf("< substituteTemplateArgumentsInString result=%s\n", qPrint(result));
return result.stripWhiteSpace();
}

Expand Down

0 comments on commit eb11063

Please sign in to comment.