[PATCH] D38718: [Sema] No -Wtautological-pointer-compare warning on variables within parentheses

Daniel Marjamäki via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 10 04:46:30 PDT 2017


danielmarjamaki added a comment.

LGTM! However I would like to see a review from somebody else also.

There are a number of diagnostics that might be affected. The Sema::DiagnoseAlwaysNonNullPointer diagnoses these:

diag::warn_this_null_compare
diag::warn_this_bool_conversion
diag::warn_address_of_reference_null_compare
diag::warn_address_of_reference_bool_conversion
diag::warn_nonnull_expr_compare
diag::warn_cast_nonnull_to_bool
diag::warn_null_pointer_compare   <-- I think this is the one bug 20951 is about
diag::warn_impcast_pointer_to_bool

It seems to me that it is an improvement for all these warnings to skip the parentheses. However there is a danger that parentheses should hide some warnings to make it possible for users to hide unwanted warnings. But if that was the design decision then some regression test should complain when we skip the parentheses.


Repository:
  rL LLVM

https://reviews.llvm.org/D38718





More information about the cfe-commits mailing list