Submitting a patch to Bugzilla 20951.
Simply replaced the function call IgnoreImpCasts to IgnoreParenImpCasts which seems to more appropriate.
I also had to modify a test cast in test/Sema/conditional-expr.c
/E
Differential D38718
[Sema] No -Wtautological-pointer-compare warning on variables within parentheses danielmarjamaki on Oct 10 2017, 3:42 AM. Authored by
Details
Submitting a patch to Bugzilla 20951. Simply replaced the function call IgnoreImpCasts to IgnoreParenImpCasts which seems to more appropriate. /E
Diff Detail
Event Timeline
Comment Actions I think a test for -Wtautological-pointer-compare should be added that shows that the bug is fixed.
Comment Actions 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 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. Comment Actions Erik and I will not continue working on this. Feel free to take over the patch or write a new patch. |
Please don't just remove previous tests.
E.g. does the old test no longer warns?