@@ -124,6 +124,7 @@ struct SymbolResolver::Private
124
124
{
125
125
m_fileScope = fileScope;
126
126
}
127
+ const FileDef *fileScope () const { return m_fileScope; }
127
128
128
129
QCString resolvedType;
129
130
const MemberDef *typeDef = nullptr ;
@@ -1204,7 +1205,8 @@ const Definition *SymbolResolver::Private::followPath(VisitedKeys &visitedKeys,
1204
1205
// try to resolve the part if it is a typedef
1205
1206
const MemberDef *memTypeDef=nullptr ;
1206
1207
QCString qualScopePart = substTypedef (visitedKeys,current,path.mid (is,l),&memTypeDef);
1207
- AUTO_TRACE_ADD (" qualScopePart={}" ,qualScopePart);
1208
+ AUTO_TRACE_ADD (" qualScopePart={} memTypeDef={}" ,qualScopePart,memTypeDef?memTypeDef->name ():" " );
1209
+ const Definition *next = nullptr ;
1208
1210
if (memTypeDef)
1209
1211
{
1210
1212
const ClassDef *type = newResolveTypedef (visitedKeys,m_fileScope,memTypeDef,nullptr ,nullptr ,nullptr );
@@ -1214,7 +1216,14 @@ const Definition *SymbolResolver::Private::followPath(VisitedKeys &visitedKeys,
1214
1216
return type;
1215
1217
}
1216
1218
}
1217
- const Definition *next = current->findInnerCompound (qualScopePart);
1219
+ else if (m_fileScope)
1220
+ {
1221
+ next = endOfPathIsUsedClass (m_fileScope->getUsedDefinitions (),qualScopePart);
1222
+ }
1223
+ if (next==nullptr )
1224
+ {
1225
+ next = current->findInnerCompound (qualScopePart);
1226
+ }
1218
1227
AUTO_TRACE_ADD (" Looking for {} inside {} result={}" ,
1219
1228
qualScopePart, current->name (), next?next->name ():QCString ());
1220
1229
if (next==nullptr )
@@ -1622,7 +1631,9 @@ const ClassDef *SymbolResolver::resolveClass(const Definition *scope,
1622
1631
scope?scope->name ():QCString (), name, mayBeUnlinkable, mayBeHidden);
1623
1632
p->reset ();
1624
1633
1625
- auto lang = scope ? scope->getLanguage () : SrcLangExt::Cpp;
1634
+ auto lang = scope ? scope->getLanguage () :
1635
+ p->fileScope () ? p->fileScope ()->getLanguage () :
1636
+ SrcLangExt::Cpp; // fallback to C++
1626
1637
1627
1638
if (scope==nullptr ||
1628
1639
(scope->definitionType ()!=Definition::TypeClass &&
0 commit comments