@@ -3200,28 +3200,30 @@ void ClassDefImpl::setTemplateArguments(const ArgumentList &al)
3200
3200
m_impl->tempArgs = al;
3201
3201
}
3202
3202
3203
- /* ! Returns \c TRUE iff this class or a class inheriting from this class
3204
- * is \e not defined in an external tag file.
3205
- */
3206
- bool ClassDefImpl::hasNonReferenceSuperClass () const
3203
+ static bool hasNonReferenceSuperClassRec (const ClassDef *cd,int level)
3207
3204
{
3208
- bool found=!isReference () && isLinkableInProject () && !isHidden ();
3205
+ bool found=!cd-> isReference () && cd-> isLinkableInProject () && !cd-> isHidden ();
3209
3206
if (found)
3210
3207
{
3211
3208
return TRUE ; // we're done if this class is not a reference
3212
3209
}
3213
- for (const auto &ibcd : m_impl-> inheritedBy )
3210
+ for (const auto &ibcd : cd-> subClasses () )
3214
3211
{
3215
- ClassDef *bcd=ibcd.classDef ;
3212
+ const ClassDef *bcd=ibcd.classDef ;
3213
+ if (level>256 )
3214
+ {
3215
+ err (" Possible recursive class relation while inside %s and looking for base class %s\n " ,qPrint (cd->name ()),qPrint (bcd->name ()));
3216
+ return FALSE ;
3217
+ }
3216
3218
// recurse into the super class branch
3217
- found = found || bcd-> hasNonReferenceSuperClass ( );
3219
+ found = found || hasNonReferenceSuperClassRec (bcd,level+ 1 );
3218
3220
if (!found)
3219
3221
{
3220
3222
// look for template instances that might have non-reference super classes
3221
3223
for (const auto &cil : bcd->getTemplateInstances ())
3222
3224
{
3223
3225
// recurse into the template instance branch
3224
- found = cil.classDef -> hasNonReferenceSuperClass ( );
3226
+ found = hasNonReferenceSuperClassRec ( cil.classDef ,level+ 1 );
3225
3227
if (found) break ;
3226
3228
}
3227
3229
}
@@ -3231,6 +3233,14 @@ bool ClassDefImpl::hasNonReferenceSuperClass() const
3231
3233
}
3232
3234
}
3233
3235
return found;
3236
+ };
3237
+
3238
+ /* ! Returns \c TRUE iff this class or a class inheriting from this class
3239
+ * is \e not defined in an external tag file.
3240
+ */
3241
+ bool ClassDefImpl::hasNonReferenceSuperClass () const
3242
+ {
3243
+ return hasNonReferenceSuperClassRec (this ,0 );
3234
3244
}
3235
3245
3236
3246
QCString ClassDefImpl::requiresClause () const
0 commit comments