summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/check.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/check.cxx')
-rw-r--r--compilerplugins/clang/check.cxx5
1 files changed, 1 insertions, 4 deletions
diff --git a/compilerplugins/clang/check.cxx b/compilerplugins/clang/check.cxx
index 9952e285b2b5..93fd7c7f7307 100644
--- a/compilerplugins/clang/check.cxx
+++ b/compilerplugins/clang/check.cxx
@@ -191,10 +191,7 @@ namespace {
bool isGlobalNamespace(clang::DeclContext const * context) {
assert(context != nullptr);
- while (!context->isLookupContext()) {
- context = context->getLookupParent();
- }
- return context->isTranslationUnit();
+ return context->getEnclosingNamespaceContext()->isTranslationUnit();
}
}