6 Commits

Author SHA1 Message Date
Carlos Galvez
e82dd5b37c [clang-tidy][NFC] Remove custom isInAnonymousNamespace matchers
Since now the same matcher exists in ASTMatchers.
2022-12-23 08:54:48 +00:00
Carlos Galvez
bf452f9b34 [clang-tidy][NFC] Replace custom isStatic matcher with the existing isStaticStorageClass 2022-12-19 15:23:50 +00:00
Carlos Galvez
35d9f873e3 [clang-tidy] Fix a couple additional cases in misc-use-anonymous-namespace only
- 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 15:26:14 +00:00
Carlos Galvez
d3c3de63ce [clang-tidy][NFC] Simply match processing in misc-use-anonymous-namespace
No need for the templated function "processMatch", since
we can infer the type with llvm:isa.
2022-12-12 14:05:19 +00:00
Carlos Galvez
7fd8387917 [clang-tidy] Do not warn about redundant static in misc-use-anonymous-namespace
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-08 11:40:50 +00:00
Carlos Galvez
65d6d67fc9 [clang-tidy] Add misc-use-anonymous-namespace check
Differential Revision: https://reviews.llvm.org/D137340
2022-12-01 07:19:30 +00:00