[PATCH] D57747: [Sema] SequenceChecker: Fix handling of operator ||, && and ?:

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 5 09:04:03 PST 2019

rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

The "false negatives" in the current behaviour are the result of an intentional decision to avoid false positives for unsequenced operations that cannot actually both happen as part of the same evaluation (because both are conditional on different and mutually-exclusive conditions), such as the false positive we now get in the tests. I think it's reasonable to revisit that decision, though; the new false positive cases do not realistically seem likely to occur in real code whereas the false negatives do.

Comment at: test/Sema/warn-unsequenced.c:79
-  (xs[7] && ++a) * (!xs[7] && ++a); // ok
+  (xs[7] && ++a) * (!xs[7] && ++a); // expected-warning {{multiple unsequenced modifications to 'a'}}
Please at least add a FIXME for this false positive.

  rC Clang



More information about the cfe-commits mailing list