[libc-commits] [PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.
Aaron Ballman via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon Apr 6 09:12:07 PDT 2020
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM!
================
Comment at: clang-tools-extra/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.cpp:21
+ Finder->addMatcher(
+ decl(hasParent(translationUnitDecl()), unless(linkageSpecDecl()))
+ .bind("child_of_translation_unit"),
----------------
PaulkaToast wrote:
> aaron.ballman wrote:
> > This skips linkage spec declarations, but are there other declarations that should be similarly skipped? For instance `static_assert` declarations?
> I believe that linkage is the only exception needed, static_asserts and all other declarations should also be within the namespace.
Excellent, thank you for verifying!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76818/new/
https://reviews.llvm.org/D76818
More information about the libc-commits
mailing list