This check makes sure all llvm-libc implementations falls within the __llvm_libc namespace.
The check is quite general, lots of projects do this by conversion to avoid pollution. Not sure if there is a desire to put this in a different module?
Differential D76818
[clang-tidy] Add check llvmlibc-implementation-in-namespace. PaulkaToast on Mar 25 2020, 6:25 PM. Authored by
Details This check makes sure all llvm-libc implementations falls within the __llvm_libc namespace. The check is quite general, lots of projects do this by conversion to avoid pollution. Not sure if there is a desire to put this in a different module?
Diff Detail
Event TimelineComment Actions Please also add isLanguageVersionSupported(), because namespaces make sense only in C++.
Comment Actions If you want to make it a general check, you should consider making the default module options set the correct namespace ClangTidyOptions getModuleOptions() override { ClangTidyOptions Options; Options.CheckOptions["llvmlibc-implementation-in-namespace.RequiredNamespace"] = "__llvm_libc"; return Options; }
Comment Actions Updated to handle nested namespaces, exclude C linkages functions, and made check language specific. (: Comment Actions Changed the check a bit so I'm not sure if pulling it out is still something desired, if so what module do you recommend this should live under?
Comment Actions This check needs a store Options override method as it reading options from a configuration. Check other checks to see how this is done.
Comment Actions Addressed njames's and aaron's comments. (:
Comment Actions LGTM!
|
This can be made const