[PATCH] D106946: [clang-tidy] Fix crash on "reference to array" parameters in 'bugprone-easily-swappable-parameters'

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 28 05:23:25 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-implicits.cpp:46
+
+void crefToArrayTypedefBoth1(const Point2D &VecDescartes, const Point3D &VecThreeD) {}
+// NO-WARN: Distinct types.
----------------
Can you also add a test case like:
```
template <int N, int M>
void func(int (&array1)[N], int (&array2)[M]) {}

void instantiate() {
  int foo[12], bar[12];
  func(foo, bar);

  int baz[12], quux[42];
  func(baz, quux);
}
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106946/new/

https://reviews.llvm.org/D106946



More information about the cfe-commits mailing list