Skip to content

Commit 6be74c1

Browse files
committed
C++: add predicate to Namespace class to retrieve associated attributes
1 parent c7b487b commit 6be74c1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ 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() { namespaceattributes(underlyingElement(this), unresolveElement(result)) }
102105
}
103106

104107
/**

0 commit comments

Comments
 (0)