[all-commits] [llvm/llvm-project] 8b0cc4: [clang-tidy] Improve "common type" diagnostic outp...

Whisperity via All-commits all-commits at lists.llvm.org
Fri Jul 23 01:26:50 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b0cc4a65dd435096bf64651693f5c9c3e2fee3b
      https://github.com/llvm/llvm-project/commit/8b0cc4a65dd435096bf64651693f5c9c3e2fee3b
  Author: Whisperity <whisperity at gmail.com>
  Date:   2021-07-23 (Fri, 23 Jul 2021)

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

  Log Message:
  -----------
  [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




More information about the All-commits mailing list