aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp
AgeCommit message (Collapse)AuthorFilesLines
2024-02-02[clang-tidy] Remove check-specific HeaderFileExtensions and Implement… ↵Carlos Galvez1-20/+2
(#80333) …ationFileExtensions Deprecated since clang-tidy 17. Use the corresponding global options instead. Fixes #61947 --------- Co-authored-by: Carlos Gálvez <carlos.galvez@zenseact.com>
2023-02-19[clang-tidy] Introduce HeaderFileExtensions and ImplementationFileExtensions ↵Carlos Galvez1-10/+15
options Re-introduce the patch that was reverted previously. In the first attempt, the checks would not be able to read from the global option, since getLocalOrGlobal only works with string types. Additional logic is needed in order to support both use cases in the transition period. All that logic will be removed when the local options are fully removed. We have a number of checks designed to analyze problems in header files only, for example: bugprone-suspicious-include google-build-namespaces llvm-header-guard misc-definitions-in-header ... All these checks duplicate the same logic and options to determine whether a location is placed in the main source file or in the header. More checks are coming up with similar requirements. Thus, to remove duplication, let's move this option to the top-level configuration of clang-tidy (since it's something all checks should share). Add a deprecation notice for all checks that use the local option, prompting to update to the global option. Differential Revision: https://reviews.llvm.org/D142655
2023-01-14[clang-tidy][NFC] Use C++17 nested namespaces in the clang-tidy folderCarlos Galvez1-6/+2
Fix applied by running: run-clang-tidy.py -checks=-*,modernize-concat-nested-namespaces Differential Revision: https://reviews.llvm.org/D141770
2022-12-23[clang-tidy][NFC] Remove custom isInAnonymousNamespace matchersCarlos Galvez1-4/+0
Since now the same matcher exists in ASTMatchers.
2022-12-19[clang-tidy][NFC] Replace custom isStatic matcher with the existing ↵Carlos Galvez1-7/+2
isStaticStorageClass
2022-12-12[clang-tidy] Fix a couple additional cases in misc-use-anonymous-namespace onlyCarlos Galvez1-3/+33
- Do not analyze header files, since we don't want to promote using anonymous namespaces there. - Do not warn about const/constexpr variables, those are implicitly static in C++ and they don't need to be moved to an anonymous namespace. Warning about redundant static in general could be implemented as a standalone check, moving away some of the functionality from this check. This check has been introduced in the current release, thus no mention of this change is needed in the Release Notes. Differential Revision: https://reviews.llvm.org/D139113
2022-12-12[clang-tidy][NFC] Simply match processing in misc-use-anonymous-namespaceCarlos Galvez1-15/+8
No need for the templated function "processMatch", since we can infer the type with llvm:isa.
2022-12-08[clang-tidy] Do not warn about redundant static in misc-use-anonymous-namespaceCarlos Galvez1-19/+12
The same functionality is already implemented in the readability-static-definition-in-anonymous-namespace check, including automatic fixes. Differential Revision: https://reviews.llvm.org/D139197
2022-12-01[clang-tidy] Add misc-use-anonymous-namespace checkCarlos Galvez1-0/+72
Differential Revision: https://reviews.llvm.org/D137340