[all-commits] [llvm/llvm-project] 2469bd: [clang-tidy] Disable misc-definitions-in-headers f...

Carlos Galvez via All-commits all-commits at lists.llvm.org
Sat Apr 1 12:19:19 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2469bd98a77242606426f8a5a8a797054c932bf0
      https://github.com/llvm/llvm-project/commit/2469bd98a77242606426f8a5a8a797054c932bf0
  Author: Carlos Galvez <carlosgalvezp at gmail.com>
  Date:   2023-04-01 (Sat, 01 Apr 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/misc/definitions-in-headers.rst
    M clang-tools-extra/test/clang-tidy/checkers/misc/definitions-in-headers.hpp

  Log Message:
  -----------
  [clang-tidy] Disable misc-definitions-in-headers for declarations in anonymous namespaces

Anonymous namespaces are another way of providing internal linkage,
and the check already ignores other cases of internal linkage in
headers, via "static" or "const".

Anonymous namespaces in headers are definitely a source of pitfalls,
but it's not the responsibility of this check to cover that. Instead,
google-build-namespaces will specifically warn about this issue.

Fixes https://github.com/llvm/llvm-project/issues/61471

Differential Revision: https://reviews.llvm.org/D147379




More information about the All-commits mailing list