summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2004-06-17 19:53:53 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2004-06-17 19:53:53 (GMT)
commit6b195c8d27c7cba3885acf1540f33ea7f51b9d1b (patch)
treee215fcacfb74cc58f4d27e30b9722efd930d7a7a /src/code.l
parent62039dd46dfca33a45f5461a3732b3a707e4ce8b (diff)
downloadDoxygen-6b195c8d27c7cba3885acf1540f33ea7f51b9d1b.zip
Doxygen-6b195c8d27c7cba3885acf1540f33ea7f51b9d1b.tar.gz
Doxygen-6b195c8d27c7cba3885acf1540f33ea7f51b9d1b.tar.bz2
Release-1.3.7-20040617
Diffstat (limited to 'src/code.l')
-rw-r--r--src/code.l28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/code.l b/src/code.l
index 7e4d281..e42b1c8 100644
--- a/src/code.l
+++ b/src/code.l
@@ -227,8 +227,30 @@ void VariableContext::addVariable(const QCString &type,const QCString &name)
}
else if ((i=ltype.find('<'))!=-1)
{
- // probably a template class, try without template arguments as well
- addVariable(ltype.left(i),name);
+ // probably a template class
+ QCString typeName(ltype.left(i));
+ ClassDef* newDef = 0;
+ QCString templateArgs(ltype.right(ltype.length() - i));
+ if (
+ ( // look for class definitions inside the code block
+ (varType=g_codeClassSDict[typeName]) ||
+ // otherwise look for global class definitions
+ (varType=getResolvedClass(g_currentDefinition,g_sourceFileDef,typeName))
+ ) && // and it must be a template
+ varType->templateArguments())
+ {
+ newDef = varType->getVariableInstance( templateArgs );
+ }
+ if (newDef)
+ {
+ DBG_CTX((stderr,"** addVariable type=%s templ=%s name=%s\n",typeName.data(),templateArgs.data(),lname.data()));
+ scope->append(lname, newDef);
+ }
+ else
+ {
+ // Doesn't seem to be a template. Try just the base name.
+ addVariable(typeName,name);
+ }
}
else // add a dummy entry so the name is hidden to avoid false links
{
@@ -914,6 +936,8 @@ static bool generateClassMemberLink(BaseCodeDocInterface &ol,ClassDef *mcd,const
//printf("g_currentDefiniton=%p g_currentMemberDef=%p xmd=%p g_insideBody=%d\n",g_currentDefinition,g_currentMemberDef,xmd,g_insideBody);
+ if (xmd->templateMaster()) xmd = xmd->templateMaster();
+
// add usage reference
if (g_currentDefinition && g_currentMemberDef &&
xmd!=g_currentMemberDef && g_insideBody)