[PATCH] D52949: [Diagnostics] Implement -Wsizeof-pointer-div

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 1 06:46:06 PDT 2018


xbolva00 added a comment.

- Addressed review comments.

We match the GCC behaviour here, except the case:
int b1 = sizeof(int *) / sizeof(int);

But I think it is ok now.



================
Comment at: lib/Sema/SemaExpr.cpp:8729
 
+static void DiagnoseDivisionSizeofPointer(Sema &S, Expr *LHS, Expr *RHS,
+                                          SourceLocation Loc) {
----------------
aaron.ballman wrote:
> `const Expr *`
if const, i have build issues with "<< LHS"


https://reviews.llvm.org/D52949





More information about the cfe-commits mailing list