The ::foo::bar is the nested name specifier.
According to https://clang.llvm.org/doxygen/classclang_1_1UsingDecl.html
UsingDecl has getQualifier().
In clang-query you can follow this for a file like this:
t.cc:
namespace a { namespace b { class C; } };
using ::C
clang_query t.cc –
set output print
clang-query> m usingDecl(has(nestedNameSpecifier().bind(“x”)))
Match #1:
Binding for “root”:
using ::C
Binding for “x”:
::
1 match.