[PATCH] D106442: [clang-tidy] Improve "common type" diagnostic output in 'bugprone-easily-swappable-parameters'

Whisperity via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 21 07:13:12 PDT 2021


whisperity created this revision.
whisperity added a reviewer: aaron.ballman.
whisperity added a project: clang-tools-extra.
Herald added subscribers: martong, gamesh411, Szelethus, dkrupp, rnkovacs, xazax.hun.
whisperity requested review of this revision.
Herald added a subscriber: cfe-commits.

Make the check handle cases of the //"common type"// involved in the mix being non-trivial, e.g. pointers, references, attributes, these things coming from typedefs, etc. This results in clearer diagnostics that have more coverage in their explanation, such as saying `const int &` as common type instead of just `int`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106442

Files:
  clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp
  clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-len2.cpp
  clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-qualifiermixing.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106442.360439.patch
Type: text/x-patch
Size: 16559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210721/5885dfdb/attachment-0001.bin>


More information about the cfe-commits mailing list