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

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 15 16:00:23 PDT 2022


mizvekov accepted this revision.
mizvekov added a comment.
This revision is now accepted and ready to land.

LGTM once minor nits are fixed. I am not opposed to getting this back to where it was, we can take a more careful look later at what this checker should be doing instead.



================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/sizeof-expression-2.c:63
+}
\ No newline at end of file

----------------
Missing newline here.


================
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
----------------
Is this change really desirable, or should we put a FIXME here?


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