[all-commits] [llvm/llvm-project] 666d22: [clang-tidy] Fix modernize-use-std-print/format fo...

Mike Crowe via All-commits all-commits at lists.llvm.org
Wed Jul 17 08:46:09 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 666d224248707f373577b5b049b5b0229100006c
      https://github.com/llvm/llvm-project/commit/666d224248707f373577b5b049b5b0229100006c
  Author: Mike Crowe <mac at mcrowe.com>
  Date:   2024-07-17 (Wed, 17 Jul 2024)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/UseStdFormatCheck.cpp
    M clang-tools-extra/clang-tidy/modernize/UseStdPrintCheck.cpp
    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-fmt.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-print-custom.cpp

  Log Message:
  -----------
  [clang-tidy] Fix modernize-use-std-print/format for fmt (#99021)

When fixing #92896 in 0e62d5cf55479981da5e05e406bbca4afb3cdc4f (#94104)
I failed to spot that I'd broken converting from fmt::printf,
fmt::fprintf and fmt::sprintf in these checks since the format parameter
of those functions is not a simple character pointer.

The first part of the previous fix to avoid the assert and instead
produce an error message was sufficient. It was only the second part
that required the format parameter of the called function to be a simple
character pointer that was problematic. Let's remove that second part
and add the now-expected error messages to the lit tests along with
fixing the prototype for the fmt functions to more accurately reflect
the ones used by the fmt library so they are actually useful.

Fixes #92896



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