Questions about Getting the Full Name in Using Declaration

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 ::a::b::C

clang_query t.cc –

set output print
clang-query> m usingDecl(has(nestedNameSpecifier().bind(“x”)))

Match #1:

Binding for “root”:
using ::a::b::C
Binding for “x”:
::a::b::
1 match.