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

Mike Crowe via All-commits all-commits at lists.llvm.org
Thu Jun 29 07:00:33 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 09ed2102eab5d3d3786046009ff0d6724118b76b
      https://github.com/llvm/llvm-project/commit/09ed2102eab5d3d3786046009ff0d6724118b76b
  Author: Mike Crowe <mac at mcrowe.com>
  Date:   2023-06-29 (Thu, 29 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