[PATCH] D131926: [clang-tidy] Fix for bugprone-sizeof-expression PR57167

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 15 21:04:37 PDT 2022


njames93 added a comment.

Please can you run git clang-format over the patch to keep the pre-merge bot happy.



================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/sizeof-expression.cpp:236-238
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
   sum += sizeof(PMyStruct);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
----------------
mizvekov wrote:
> Is this change really desirable, or should we put a FIXME here?
Not warning on these cases seems like a pretty big red flag, especially the `MyStruct *`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131926



More information about the cfe-commits mailing list