@@ -79,10 +79,9 @@ static QCString makeQualifiedNameWithTemplateParameters(const ClassDef *cd,
7979 if (!scName.isEmpty ()) scName+=scopeSeparator;
8080
8181 bool isSpecialization = cd->localName ().find (' <' )!=-1 ;
82-
8382 QCString clName = cd->className ();
8483 scName+=clName;
85- if (!cd->templateArguments ().empty ())
84+ if (lang!=SrcLangExt::CSharp && !cd->templateArguments ().empty ())
8685 {
8786 if (actualParams && *actualParamIndex<actualParams->size ())
8887 {
@@ -802,6 +801,7 @@ ClassDefImpl::ClassDefImpl(
802801 bool isSymbol,bool isJavaEnum)
803802 : DefinitionMixin(defFileName,defLine,defColumn,removeRedundantWhiteSpace(nm),nullptr,nullptr,isSymbol)
804803{
804+ AUTO_TRACE (" name={}" ,name ());
805805 setReference (lref);
806806 m_compType = ct;
807807 m_isJavaEnum = isJavaEnum;
@@ -853,6 +853,7 @@ ClassDefImpl::ClassDefImpl(
853853 {
854854 m_fileName = convertNameToFile (m_fileName);
855855 }
856+ AUTO_TRACE_EXIT (" m_fileName='{}'" ,m_fileName);
856857}
857858
858859std::unique_ptr<ClassDef> ClassDefImpl::deepCopy (const QCString &name) const
@@ -861,6 +862,13 @@ std::unique_ptr<ClassDef> ClassDefImpl::deepCopy(const QCString &name) const
861862 auto result = std::make_unique<ClassDefImpl>(
862863 getDefFileName (),getDefLine (),getDefColumn (),name,compoundType (),
863864 std::string (),std::string (),true ,m_isJavaEnum);
865+ result->setBriefDescription (briefDescription (),briefFile (),briefLine ());
866+ result->setDocumentation (documentation (),docFile (),docLine ());
867+ result->setInbodyDocumentation (inbodyDocumentation (),inbodyFile (),inbodyLine ());
868+ result->setBodySegment (getStartDefLine (),getStartBodyLine (),getEndBodyLine ());
869+ result->setBodyDef (getBodyDef ());
870+ result->setLanguage (getLanguage ());
871+
864872 // copy other members
865873 result->m_memberListFileName = m_memberListFileName;
866874 result->m_collabFileName = m_collabFileName;
@@ -2353,7 +2361,7 @@ void ClassDefImpl::writeTagFile(TextStream &tagFile) const
23532361 {
23542362 for (const auto &innerCd : m_innerClasses)
23552363 {
2356- if (innerCd->isLinkableInProject () && innerCd->templateMaster ()== nullptr &&
2364+ if (innerCd->isLinkableInProject () && ! innerCd->isImplicitTemplateInstance () &&
23572365 protectionLevelVisible (innerCd->protection ()) &&
23582366 !innerCd->isEmbeddedInOuterScope ()
23592367 )
@@ -2946,6 +2954,7 @@ void ClassDefImpl::writeDocumentation(OutputList &ol) const
29462954 hli = HighlightedItem::ClassVisible;
29472955 }
29482956
2957+ AUTO_TRACE (" name='{}' getOutputFileBase='{}'" ,name (),getOutputFileBase ());
29492958 startFile (ol,getOutputFileBase (),name (),pageTitle,hli,!generateTreeView);
29502959 if (!generateTreeView)
29512960 {
@@ -3043,7 +3052,7 @@ void ClassDefImpl::writeDocumentationForInnerClasses(OutputList &ol) const
30433052 for (const auto &innerCd : m_innerClasses)
30443053 {
30453054 if (
3046- innerCd->isLinkableInProject () && innerCd->templateMaster ()== nullptr &&
3055+ innerCd->isLinkableInProject () && ! innerCd->isImplicitTemplateInstance () &&
30473056 protectionLevelVisible (innerCd->protection ()) &&
30483057 !innerCd->isEmbeddedInOuterScope ()
30493058 )
@@ -3534,7 +3543,7 @@ bool ClassDefImpl::isLinkableInProject() const
35343543 bool extractLocal = Config_getBool (EXTRACT_LOCAL_CLASSES);
35353544 bool extractStatic = Config_getBool (EXTRACT_STATIC);
35363545 bool hideUndoc = Config_getBool (HIDE_UNDOC_CLASSES);
3537- if (m_templateMaster)
3546+ if (m_templateMaster && m_implicitTemplateInstance )
35383547 {
35393548 return m_templateMaster->isLinkableInProject ();
35403549 }
@@ -3563,7 +3572,7 @@ bool ClassDefImpl::isLinkableInProject() const
35633572
35643573bool ClassDefImpl::isLinkable () const
35653574{
3566- if (m_templateMaster)
3575+ if (m_templateMaster && m_implicitTemplateInstance )
35673576 {
35683577 return m_templateMaster->isLinkable ();
35693578 }
@@ -3593,6 +3602,8 @@ bool ClassDefImpl::isVisibleInHierarchy() const
35933602 (m_templateMaster && m_templateMaster->hasDocumentation ()) ||
35943603 isReference ()
35953604 ) &&
3605+ // if this is an implicit template instance then it most be part of the inheritance hierarchy
3606+ (!m_implicitTemplateInstance || !m_inherits.empty () || !m_inheritedBy.empty ()) &&
35963607 // is not part of an unnamed namespace or shown anyway
35973608 (!m_isStatic || extractStatic);
35983609}
@@ -4209,7 +4220,8 @@ QCString ClassDefImpl::getOutputFileBase() const
42094220 }
42104221 }
42114222 }
4212- if (m_templateMaster)
4223+ AUTO_TRACE (" name='{}' m_templateMaster={} m_implicitTemplateInstance={}" ,name (),(void *)m_templateMaster,m_implicitTemplateInstance);
4224+ if (m_templateMaster && m_implicitTemplateInstance)
42134225 {
42144226 // point to the template of which this class is an instance
42154227 return m_templateMaster->getOutputFileBase ();
@@ -4224,7 +4236,7 @@ QCString ClassDefImpl::getInstanceOutputFileBase() const
42244236
42254237QCString ClassDefImpl::getSourceFileBase () const
42264238{
4227- if (m_templateMaster)
4239+ if (m_templateMaster && m_implicitTemplateInstance )
42284240 {
42294241 return m_templateMaster->getSourceFileBase ();
42304242 }
@@ -4396,7 +4408,7 @@ void ClassDefImpl::addMembersToTemplateInstance(const ClassDef *cd,const Argumen
43964408
43974409QCString ClassDefImpl::getReference () const
43984410{
4399- if (m_templateMaster)
4411+ if (m_templateMaster && m_implicitTemplateInstance )
44004412 {
44014413 return m_templateMaster->getReference ();
44024414 }
@@ -4408,7 +4420,7 @@ QCString ClassDefImpl::getReference() const
44084420
44094421bool ClassDefImpl::isReference () const
44104422{
4411- if (m_templateMaster)
4423+ if (m_templateMaster && m_implicitTemplateInstance )
44124424 {
44134425 return m_templateMaster->isReference ();
44144426 }
@@ -4442,14 +4454,13 @@ QCString ClassDefImpl::qualifiedNameWithTemplateParameters(
44424454
44434455QCString ClassDefImpl::className () const
44444456{
4445- if (m_className.isEmpty ())
4446- {
4447- return localName ();
4448- }
4449- else
4457+ QCString name = m_className.isEmpty () ? localName () : m_className;
4458+ auto lang = getLanguage ();
4459+ if (lang==SrcLangExt::CSharp)
44504460 {
4451- return m_className ;
4461+ name = demangleCSharpGenericName (name, tempArgListToString ( templateArguments (),lang)) ;
44524462 }
4463+ return name;
44534464}
44544465
44554466void ClassDefImpl::setClassName (const QCString &name)
@@ -5154,7 +5165,7 @@ QCString ClassDefImpl::anchor() const
51545165 QCString anc;
51555166 if (isEmbeddedInOuterScope () && !Doxygen::generatingXmlOutput)
51565167 {
5157- if (m_templateMaster)
5168+ if (m_templateMaster && m_implicitTemplateInstance )
51585169 {
51595170 // point to the template of which this class is an instance
51605171 anc = m_templateMaster->getOutputFileBase ();
0 commit comments