Skip to content

Commit 73675e2

Browse files
authored
Merge pull request #138 from ian-semmle/topLevel
C++: Use Declaration.isTopLevel() in GlobalNamespace.getADeclaration()
2 parents 6e9cc46 + c8fcab8 commit 73675e2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,8 @@ class GlobalNamespace extends Namespace {
195195
not result instanceof Function
196196
) and
197197
not exists(ConditionDeclExpr cde | cde.getVariable() = result) and
198-
not exists(Enum e | e.getAnEnumConstant() = result) and
199-
not result instanceof Parameter and
200-
not result instanceof ProxyClass and
201-
not result instanceof TemplateParameter and
202-
not result instanceof LocalVariable and
203-
not namespacembrs(_, unresolveElement(result)) and
204-
not result.isMember()
198+
result.isTopLevel() and
199+
not namespacembrs(_, unresolveElement(result))
205200
}
206201

207202
/** Gets a child namespace of the global namespace. */

0 commit comments

Comments
 (0)