[all-commits] [llvm/llvm-project] 473eff: [clang-tidy] Fix crash and handle AttributedType i...

Whisperity via All-commits all-commits at lists.llvm.org
Thu Jul 22 01:40:23 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 473eff1c3057185758bf35f0c052a873b1bdb6a9
      https://github.com/llvm/llvm-project/commit/473eff1c3057185758bf35f0c052a873b1bdb6a9
  Author: Whisperity <whisperity at gmail.com>
  Date:   2021-07-22 (Thu, 22 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] Fix crash and handle AttributedType in 'bugprone-easily-swappable-parameters'

@vabridgers identified a way to crash the check by running on code that
involve `AttributedType`s. This patch fixes the check to first and
foremost not crash, but also improves the logic handling qualifiers.

If the types contain any additional (not just CVR) qualifiers that are
not the same, they will not be deemed mixable. The logic for CVR-Mixing
and the `QualifiersMix` check option remain unchanged.

Reviewed By: aaron.ballman, vabridgers

Differential Revision: http://reviews.llvm.org/D106361




More information about the All-commits mailing list