compilerplugins/clang/check.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
New commits: commit 19d623d54503327e47f6effa3507342ddbea3d73 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Apr 5 11:53:16 2022 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue Apr 5 14:40:07 2022 +0200 Simplify GlobalNamespace check Change-Id: Id70abc5d1ccdc41dc771fe77ad0e7584efe76826 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132569 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> 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(); } }