This is an archive of the discontinued LLVM Phabricator instance.

Expand -Wlogical-not-parentheses to also fire on `!x & A`.
ClosedPublic

Authored by thakis on Oct 27 2016, 8:56 AM.

Details

Reviewers
hans
Summary

This is a misspelling of the intended !(x & A) negated bit test that happens in practice every now and then.

I ran this on Chromium and all its dependencies, and it fired 0 times -- no false or true positives, but it would've caught a bug in an in-progress change that had to be caught by a Visual Studio warning instead.

Diff Detail

Event Timeline

thakis updated this revision to Diff 76049.Oct 27 2016, 8:56 AM
thakis retitled this revision from to Expand -Wlogical-not-parentheses to also fire on `!x & A`..
thakis updated this object.
thakis added a reviewer: hans.
thakis added a subscriber: cfe-commits.
hans accepted this revision.Oct 27 2016, 9:17 AM
hans edited edge metadata.

lgtm, very nice! (with one clarifying question)

test/SemaCXX/warn-logical-not-compare.cpp
224

And this is the reason you had to put a "not" on the second run line, right?

This revision is now accepted and ready to land.Oct 27 2016, 9:17 AM

Thanks! Landing…

test/SemaCXX/warn-logical-not-compare.cpp
224

Right.

thakis closed this revision.Oct 27 2016, 9:41 AM

285310