C++: Add Declaration.hasStdName

This commit is contained in:
Robert Marsh
2019-07-11 15:57:26 -07:00
parent 98b97b09be
commit bff68a00ac

View File

@@ -119,9 +119,17 @@ abstract class Declaration extends Locatable, @declaration {
/** Holds if this declaration has the given name in the global namespace. */
predicate hasGlobalName(string name) { this.hasQualifiedName("", "", name) }
/** Holds if this declaration has the given name in the `std` namespace. */
predicate hasStdName(string name) {
this.hasQualifiedName("std", "", name)
}
/** Holds if this declaration has the given name in the global namespace or the `std` namespace. */
predicate hasGlobalOrStdName(string name) {
this.hasQualifiedName("std", "", name)
this.hasGlobalName(name)
or
this.hasStdName(name)
}
/** Gets a specifier of this declaration. */