[PATCH] D124446: [clang-tidy] Add the misc-discarded-return-value check

Benedek Attila Bahrami via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 26 04:48:39 PDT 2022


bahramib created this revision.
bahramib added reviewers: aaron.ballman, njames93, whisperity.
bahramib added a project: clang-tools-extra.
Herald added subscribers: carlosgalvezp, rnkovacs, xazax.hun, mgorny.
Herald added a project: All.
bahramib requested review of this revision.

Flags function calls which return value is discarded if most of the other calls
of the function consume the return value. This check takes the threshold
for "most" as a config option and works on statistics gathered from the
call sites encountered in the analyzed file.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124446

Files:
  clang-tools-extra/clang-tidy/misc/CMakeLists.txt
  clang-tools-extra/clang-tidy/misc/DiscardedReturnValueCheck.cpp
  clang-tools-extra/clang-tidy/misc/DiscardedReturnValueCheck.h
  clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/misc-discarded-return-value.rst
  clang-tools-extra/test/clang-tidy/checkers/misc-discarded-return-value-50p.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124446.425182.patch
Type: text/x-patch
Size: 44276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220426/0042dbde/attachment-0001.bin>


More information about the cfe-commits mailing list