summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classdef.cpp5
-rw-r--r--src/classdef.h3
-rw-r--r--src/doxygen.cpp9
-rw-r--r--src/entry.h1
-rw-r--r--src/scanner.l1
5 files changed, 15 insertions, 4 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index cef4720..522a53c 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -4364,6 +4364,11 @@ bool ClassDef::isPublished() const
return m_impl->spec&Entry::Published;
}
+bool ClassDef::isForwardDeclared() const
+{
+ return m_impl->spec&Entry::ForwardDecl;
+}
+
bool ClassDef::isObjectiveC() const
{
return getLanguage()==SrcLangExt_ObjC;
diff --git a/src/classdef.h b/src/classdef.h
index 8c5bebf..dee4ef4 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -271,6 +271,9 @@ class ClassDef : public Definition
/** Returns TRUE if this class represents an Objective-C 2.0 extension (nameless category) */
bool isExtension() const;
+ /** Returns TRUE if this class represents a forward declaration of a template class */
+ bool isForwardDeclared() const;
+
/** Returns the class of which this is a category (Objective-C only) */
ClassDef *categoryOf() const;
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index df67fd1..c012050 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -1256,7 +1256,7 @@ static void addClassToContext(EntryNav *rootNav)
Debug::print(Debug::Classes,0, " Found class with name %s (qualifiedName=%s -> cd=%p)\n",
cd ? cd->name().data() : root->name.data(), qualifiedName.data(),cd);
- if (cd)
+ if (cd)
{
fullName=cd->name();
Debug::print(Debug::Classes,0," Existing class %s!\n",cd->name().data());
@@ -1276,11 +1276,12 @@ static void addClassToContext(EntryNav *rootNav)
}
//cd->setName(fullName); // change name to match docs
- if (cd->templateArguments()==0)
+ if (cd->templateArguments()==0 || (cd->isForwardDeclared() && (root->spec&Entry::ForwardDecl)==0))
{
// this happens if a template class declared with @class is found
- // before the actual definition.
- ArgumentList *tArgList =
+ // before the actual definition or if a forward declaration has different template
+ // parameter names.
+ ArgumentList *tArgList =
getTemplateArgumentsFromName(cd->name(),root->tArgLists);
cd->setTemplateArguments(tArgList);
}
diff --git a/src/entry.h b/src/entry.h
index 3e5f3d7..2cc2827 100644
--- a/src/entry.h
+++ b/src/entry.h
@@ -133,6 +133,7 @@ class Entry
static const uint64 Enum = (1ULL<<12); // for Java-style enums
static const uint64 Service = (1ULL<<13); // UNO IDL
static const uint64 Singleton = (1ULL<<14); // UNO IDL
+ static const uint64 ForwardDecl = (1ULL<<14); // forward declarad template classes
// member specifiers (add new items to the beginning)
static const uint64 PrivateGettable = (1ULL<<20); // C# private getter
diff --git a/src/scanner.l b/src/scanner.l
index 50e3b18..5b698cc 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -5300,6 +5300,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
{
prependScope();
}
+ current->spec|=Entry::ForwardDecl;
current_root->addSubEntry(current);
current = new Entry;
}