Skip to content

Commit c8fcab8

Browse files
committed
C++: Use Declaration.isTopLevel() in GlobalNamespace.getADeclaration()
1 parent d4f9b5e commit c8fcab8

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)