[clang-tidy] Improve "common type" diagnostic output in 'bugprone-easily-swappable...
authorWhisperity <whisperity@gmail.com>
Wed, 21 Jul 2021 14:09:39 +0000 (16:09 +0200)
committerWhisperity <whisperity@gmail.com>
Fri, 23 Jul 2021 08:26:22 +0000 (10:26 +0200)
commit8b0cc4a65dd435096bf64651693f5c9c3e2fee3b
treeafd6fcc2ec0a44ff214cffb6f5a3615a45208601
parent6c1f65581891265154db4fb789a2d9cf4893b9bf
[clang-tidy] Improve "common type" diagnostic output in 'bugprone-easily-swappable-parameters'

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
`int`.

Reviewed By: aaron.ballman

Differential Revision: http://reviews.llvm.org/D106442
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