Skip to content

Commit e6f1183

Browse files
committed
C++: add predicate to Namespace class to retrieve associated attributes
1 parent b112b93 commit e6f1183

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cpp/ql/lib/semmle/code/cpp/Namespace.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ class Namespace extends NameQualifyingElement, @namespace {
9999

100100
/** Gets a file which declares (part of) this namespace. */
101101
File getAFile() { result = this.getADeclarationEntry().getLocation().getFile() }
102+
103+
/** Gets an attribute of this namespace. */
104+
Attribute getAnAttribute() {
105+
namespaceattributes(underlyingElement(this), unresolveElement(result))
106+
}
102107
}
103108

104109
/**

0 commit comments

Comments
 (0)