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

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 10 06:45:07 PDT 2018


xbolva00 added a comment.

In https://reviews.llvm.org/D52949#1259947, @jfb wrote:

> Can you add tests with arrays?


Yes :)

> The error message doesn't really say what to do instead. What's wrong? What's correct instead?

What do you suggest? "division produces the incorrect number of array elements; pass the length of array as a function argument"?

> In C++17 and later we should suggest using `std::size` for some cases instead.

Ok, good idea.


https://reviews.llvm.org/D52949





More information about the cfe-commits mailing list