[all-commits] [llvm/llvm-project] 6fc32e: [clang-tidy] do not diagnose array types within im...

St. Muench via All-commits all-commits at lists.llvm.org
Sun Sep 7 12:54:59 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6fc32e93066c59a39b3c8c9be4e4f416653a917e
      https://github.com/llvm/llvm-project/commit/6fc32e93066c59a39b3c8c9be4e4f416653a917e
  Author: St. Muench <stmuench at gmx.net>
  Date:   2025-09-07 (Sun, 07 Sep 2025)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-ignores-strings.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays.cpp

  Log Message:
  -----------
  [clang-tidy] do not diagnose array types within implicit instantiations of a template (#132924)

So far, the clang-tidy check `modernize-avoid-c-arrays` also diagnosed
array types for type template parameters even though no actual array
type got written there but it got deduced to one. In such case, there is
nothing a developer can do at that location to fix the diagnostic. Since
in this case, the location where the template got actually instantiated
would have to be adjusted. And this is in most cases some totally
distant code where implementers of a template do not have access to.
Also adding suppressions to the declaration of the template is not an
option since that would clutter the code unnecessarily and is in many
cases also simply not possible (e.g. for users of a template). Hence, we
propose to not diagnose any occurrence of an array type in an implicit
instantiation of a template but rather at the point where template
arguments involve array types.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list