diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2004-06-17 19:53:53 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2004-06-17 19:53:53 (GMT) |
commit | d3c3bbd02543280d12a763d82aa5b54ce516c57f (patch) | |
tree | e215fcacfb74cc58f4d27e30b9722efd930d7a7a /src/code.l | |
parent | f309c3c0e7c1cf29df6b850e19d647e93a30ce28 (diff) | |
download | Doxygen-d3c3bbd02543280d12a763d82aa5b54ce516c57f.zip Doxygen-d3c3bbd02543280d12a763d82aa5b54ce516c57f.tar.gz Doxygen-d3c3bbd02543280d12a763d82aa5b54ce516c57f.tar.bz2 |
Release-1.3.7-20040617
Diffstat (limited to 'src/code.l')
-rw-r--r-- | src/code.l | 28 |
1 files changed, 26 insertions, 2 deletions
@@ -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) |