CodeQL library for C/C++
codeql/cpp-all 2.0.1-dev (changelog, source)
Search

Member predicate Declaration::getNamespace

Gets the innermost namespace which contains this declaration.

The result will either be GlobalNamespace, or the tightest lexically enclosing namespace block. In particular, note that for declarations within structures, the namespace of the declaration is the same as the namespace of the structure.

Namespace getNamespace()