Skip to content

Commit bff68a0

Browse files
author
Robert Marsh
committed
C++: Add Declaration.hasStdName
1 parent 98b97b0 commit bff68a0

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

cpp/ql/src/semmle/code/cpp/Declaration.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,17 @@ abstract class Declaration extends Locatable, @declaration {
119119
/** Holds if this declaration has the given name in the global namespace. */
120120
predicate hasGlobalName(string name) { this.hasQualifiedName("", "", name) }
121121

122+
123+
/** Holds if this declaration has the given name in the `std` namespace. */
124+
predicate hasStdName(string name) {
125+
this.hasQualifiedName("std", "", name)
126+
}
127+
122128
/** Holds if this declaration has the given name in the global namespace or the `std` namespace. */
123129
predicate hasGlobalOrStdName(string name) {
124-
this.hasQualifiedName("std", "", name)
130+
this.hasGlobalName(name)
131+
or
132+
this.hasStdName(name)
125133
}
126134

127135
/** Gets a specifier of this declaration. */

0 commit comments

Comments
 (0)