[PATCH] D124918: Add a new clang-tidy for non-trivial unused variables.

Luca Versari via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 4 05:43:32 PDT 2022


veluca93 created this revision.
Herald added subscribers: carlosgalvezp, mgorny.
Herald added a project: All.
veluca93 requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

This check is meant to detect case that -Wunused-variable does not,
by integrating some extra knowledge of types. For example, a
std::vector<int> that only ever gets push_back()-ed is similar to a
written-but-never-read variable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124918

Files:
  clang-tools-extra/clang-tidy/performance/CMakeLists.txt
  clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
  clang-tools-extra/clang-tidy/performance/UnusedNoSideEffectCheck.cpp
  clang-tools-extra/clang-tidy/performance/UnusedNoSideEffectCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/performance-unused-no-side-effect.rst
  clang-tools-extra/test/clang-tidy/checkers/performance-unused-no-side-effect.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124918.426973.patch
Type: text/x-patch
Size: 39035 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220504/b18c0a8b/attachment-0001.bin>


More information about the cfe-commits mailing list