diff --git a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp --- a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp @@ -962,11 +962,8 @@ // LValue->RValue is irrelevant for the check, because it is a thing to be // done at a call site, and will be performed if need be performed. - // Array->Ptr decay. - if (const auto *ArrayT = dyn_cast(From)) { - LLVM_DEBUG(llvm::dbgs() << "--- approximateStdConv. Array->Ptr decayed.\n"); - WorkType = ArrayT->getPointeeType(); - } + // Array->Pointer decay is handled by the main method in desugaring + // the parameter's DecayedType as "useless sugar". // Function->Pointer conversions are also irrelevant, because a // "FunctionType" cannot be the type of a parameter variable, so this diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-implicits.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-implicits.cpp --- a/clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-implicits.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-implicits.cpp @@ -303,3 +303,11 @@ void templateConversion(IntConverter IC, FloatConverter FC) { templateConversion(FC, IC); } // Note: even though this swap is possible, we do not model things when it comes to "template magic". // But at least the check should not crash! + +typedef int Point[2]; + +void crefToArrayTypedef1(int I, const Point &P) {} +// NO-WARN. + +void crefToArrayTypedef2(int *IA, const Point &P) {} +// NO-WARN. diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-len2.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-len2.cpp --- a/clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-len2.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-len2.cpp @@ -383,3 +383,11 @@ void attributedParam4(const __attribute__((address_space(512))) int *One, const __attribute__((address_space(256))) MyInt1 *Two) {} // NO-WARN: Different value of the attribute. + +typedef int Point[2]; + +void crefToArrayTypedef1(int I, const Point &P) {} +// NO-WARN. + +void crefToArrayTypedef2(int *IA, const Point &P) {} +// NO-WARN.