aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land.
LGTM aside from a testing request. ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-sizeof-expression.cpp:301 + sum += sizeof(PtrArray) / sizeof(PtrArray[0]); + sum += sizeof(PtrArray) / sizeof(PtrArray1[0]); return sum; ---------------- I think this is missing some test coverage for cases like: ``` sum += sizeof(PtrArray) / sizeof(PtrArray[1]); // Bad array index sum += sizeof(PtrArray) / sizeof(A[0]); // Different array types ``` Also, if you can add a comment to the `sum += sizeof(PtrArray) / sizeof(PtrArray1[0]);` test case about why this passes (same canonical types), that'd be appreciated since the test case is a bit subtle. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91543/new/ https://reviews.llvm.org/D91543 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits