[all-commits] [llvm/llvm-project] 35d9f8: [clang-tidy] Fix a couple additional cases in misc...

Carlos Galvez via All-commits all-commits at lists.llvm.org
Mon Dec 12 07:26:34 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 35d9f873e3f21846de1b8f07271feedbbe8518ed
      https://github.com/llvm/llvm-project/commit/35d9f873e3f21846de1b8f07271feedbbe8518ed
  Author: Carlos Galvez <carlosgalvezp at gmail.com>
  Date:   2022-12-12 (Mon, 12 Dec 2022)

  Changed paths:
    M clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp
    M clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.h
    M clang-tools-extra/docs/clang-tidy/checks/misc/use-anonymous-namespace.rst
    A clang-tools-extra/test/clang-tidy/checkers/misc/Inputs/use-anonymous-namespace.h
    M clang-tools-extra/test/clang-tidy/checkers/misc/use-anonymous-namespace.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list