[all-commits] [llvm/llvm-project] 60bf97: [clang-tidy] modernize-use-std-print, format: Fix c...

Mike Crowe via All-commits all-commits at lists.llvm.org
Thu Jul 24 12:41:02 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 60bf97983df3efeb17f6db19b811b68fa74df9aa
      https://github.com/llvm/llvm-project/commit/60bf97983df3efeb17f6db19b811b68fa74df9aa
  Author: Mike Crowe <mac at mcrowe.com>
  Date:   2025-07-24 (Thu, 24 Jul 2025)

  Changed paths:
    M clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format-custom.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-print-absl.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-print-custom.cpp

  Log Message:
  -----------
  [clang-tidy] modernize-use-std-print,format: Fix checks with Abseil functions (#142312)

These checks previously failed with absl::StrFormat and absl::PrintF
etc. with:

 Unable to use 'std::format' instead of 'StrFormat' because first
 argument is not a narrow string literal [modernize-use-std-format]

because FormatStringConverter was rejecting the format string if it had
already converted into a different type. Fix the tests so that they
check this case properly by accepting string_view rather than const char
* and fix the check so that these tests pass. Update the existing tests
that checked for the error message that can no longer happen.

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



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