[all-commits] [llvm/llvm-project] 3e12b2: [clang-tidy] Fix modernize-use-std-print check whe...

Mike Crowe via All-commits all-commits at lists.llvm.org
Tue Jun 27 10:24:23 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3e12b2e207cfa802937488a2c0b90d482eaf00a9
      https://github.com/llvm/llvm-project/commit/3e12b2e207cfa802937488a2c0b90d482eaf00a9
  Author: Mike Crowe <mac at mcrowe.com>
  Date:   2023-06-27 (Tue, 27 Jun 2023)

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

  Log Message:
  -----------
  [clang-tidy] Fix modernize-use-std-print check when return value used

The initial implementation of the modernize-use-std-print check was
capable of converting calls to printf (etc.) which used the return value
to calls to std::print which has no return value, thus breaking the
code.

Use code inspired by the implementation of bugprone-unused-return-value
check to ignore cases where the return value is used. Add appropriate
lit test cases and documentation.

Reviewed By: PiotrZSL

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




More information about the All-commits mailing list