@@ -149,7 +149,8 @@ struct SymbolResolver::Private
149
149
bool accessibleViaUsingNamespace (StringUnorderedSet &visited,
150
150
const LinkedRefMap<const NamespaceDef> &nl,
151
151
const Definition *item,
152
- const QCString &explicitScopePart=" " );
152
+ const QCString &explicitScopePart=" " ,
153
+ int level=0 );
153
154
bool accessibleViaUsingClass (const LinkedRefMap<const ClassDef> &cl,
154
155
const Definition *item,
155
156
const QCString &explicitScopePart=" "
@@ -835,35 +836,36 @@ const Definition *SymbolResolver::Private::endOfPathIsUsedClass(LinkedRefMap<con
835
836
bool SymbolResolver::Private::accessibleViaUsingNamespace (StringUnorderedSet &visited,
836
837
const LinkedRefMap<const NamespaceDef> &nl,
837
838
const Definition *item,
838
- const QCString &explicitScopePart)
839
+ const QCString &explicitScopePart,
840
+ int level)
839
841
{
842
+ // size_t count=0;
840
843
for (const auto &und : nl) // check used namespaces for the class
841
844
{
842
- // printf("[Trying via used namespace %s: count=%d/%d \n",qPrint(und->name()),
843
- // count,nl->count ());
845
+ // printf("%d [Trying via used namespace %s: count=%zu/%zu \n",level ,qPrint(und->name()),
846
+ // count++ ,nl.size ());
844
847
const Definition *sc = explicitScopePart.isEmpty () ? und : followPath (und,explicitScopePart);
845
848
if (sc && item->getOuterScope ()==sc)
846
849
{
847
- // printf("] found it\n");
850
+ // printf("%d ] found it\n",level );
848
851
return true ;
849
852
}
850
853
if (item->getLanguage ()==SrcLangExt_Cpp)
851
854
{
852
- QCString key=und->name ();
855
+ QCString key=und->qualifiedName ();
853
856
if (!und->getUsedNamespaces ().empty () && visited.find (key.str ())==visited.end ())
854
857
{
855
858
visited.insert (key.str ());
856
859
857
- if (accessibleViaUsingNamespace (visited,und->getUsedNamespaces (),item,explicitScopePart))
860
+ if (accessibleViaUsingNamespace (visited,und->getUsedNamespaces (),item,explicitScopePart,level+ 1 ))
858
861
{
859
- // printf("] found it via recursion\n");
862
+ // printf("%d ] found it via recursion\n",level );
860
863
return true ;
861
864
}
862
865
863
- visited.erase (key.str ());
864
866
}
865
867
}
866
- // printf("] Try via used namespace done\n");
868
+ // printf("%d ] Try via used namespace done\n",level );
867
869
}
868
870
return false ;
869
871
}
@@ -952,7 +954,7 @@ int SymbolResolver::Private::isAccessibleFrom(AccessStack &accessStack,
952
954
goto done;
953
955
}
954
956
StringUnorderedSet visited;
955
- if (accessibleViaUsingNamespace (visited,nscope->getUsedNamespaces (),item))
957
+ if (accessibleViaUsingNamespace (visited,nscope->getUsedNamespaces (),item, 0 ))
956
958
{
957
959
// printf("> found via used namespace\n");
958
960
goto done;
0 commit comments