[PATCH] D91543: [clang-tidy] Improving bugprone-sizeof-expr check.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 18 08:32:29 PST 2020


balazske added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-sizeof-expression.cpp:317
+  sum = sizeof(PtrArray) / sizeof(PtrArray1[0]);
+  // There is no warning for 'sizeof(T*)/sizeof(Q)' case.
+  sum += sizeof(PtrArray) / sizeof(A[0]);
----------------
aaron.ballman wrote:
> Thanks for the new test case, can you also add one for `array[1]` (with the incorrect index) and add a FIXME to the comment so it's clear that we know we don't handle these cases currently but might like to someday?
The test for `array[1]` is not the same that is inserted on line 245?



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91543



More information about the cfe-commits mailing list