[PATCH] D53771: [clang-tidy] Avoid C arrays check

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 26 13:32:29 PDT 2018


JonasToth added inline comments.


================
Comment at: test/clang-tidy/misc-avoid-c-arrays.cpp:14
+
+template <typename T, int Size>
+class array {
----------------
lebedev.ri wrote:
> JonasToth wrote:
> > Please add a case with templates, where `T` itself is the array type, maybe there are other fancy template tricks that could create an array implictly?
> Oh i see, `array<int[4], 2>` is not diagnosed, that is where it gets interesting :S
> So i need to match `type(arrayType())`, and then find the location to complain about
> (the type does not seem to have it).
you could leave it as known limitation as well.
If the type `T` is then diagnosed as array creation through template-instantiation the warning is still valid.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53771





More information about the cfe-commits mailing list