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

Luca Versari via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 16 09:19:08 PDT 2022


veluca93 added inline comments.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/performance-unused-no-side-effect.rst:93
+   {
+      "std::string": ["swap"],
+      "absl::int128": [],
----------------
LegalizeAdulthood wrote:
> Since `std::string` is just a type alias, shouldn't we be considering `basic_string`?
> What about `wstring`?
Looks like std::string is indeed unnecessary.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/performance-unused-no-side-effect.rst:172-173
+List of functions that are considered not to read some of their arguments
+unless their return value is read. Arguments are identified by a bitmask, where
+the i-th LSB being set indicates that the i-th argument is unused.
+
----------------
LegalizeAdulthood wrote:
> This isn't user-friendly at all.  Why not an array of argument indices starting at zero?
Done. I'm using an empty array to indicate "everything", which is perhaps a bit weird.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124918/new/

https://reviews.llvm.org/D124918



More information about the cfe-commits mailing list