[PATCH] D61260: [clang-tidy] Extend bugprone-sizeof-expression to check sizeof(pointers to structures)

Balogh, Ádám via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 3 05:32:21 PDT 2019


baloghadamsoftware marked 2 inline comments as done.
baloghadamsoftware added inline comments.


================
Comment at: test/clang-tidy/bugprone-sizeof-expression.cpp:196
   typedef const MyStruct TMyStruct;
+  typedef const MyStruct *PMyStruct;
 
----------------
whisperity wrote:
> While I trust Clang and the matchers to unroll the type and still match, I'd prefer also adding a test case for
> 
> ```
> typedef TMyStruct* PMyStruct2;
> ```
> 
> or somesuch.
> 
> And perhaps a "copy" of these cases where they come from template arguments, in case the checker can also warn for that?
I added the new test, but templates are outside the scope of this particular patch. They should be tested (and fixed if the tests fail) in another patch.


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

https://reviews.llvm.org/D61260





More information about the cfe-commits mailing list