This is an archive of the discontinued LLVM Phabricator instance.

Assignment and Inc/Dec operators wouldn't register as a mutation when Implicit Paren Casts were present
ClosedPublic

Authored by Tridacnid on May 13 2020, 3:40 PM.

Details

Summary

Add ignoringParenImpCasts to assignment and inc/dec mutation checks in ExprMutationAnalyzer to fix clang-tidy bug PR45490.
https://bugs.llvm.org/show_bug.cgi?id=45490

Diff Detail

Event Timeline

Tridacnid created this revision.May 13 2020, 3:40 PM
Tridacnid updated this revision to Diff 263885.May 13 2020, 4:31 PM

Apply clang-format patch.

I don't think that did what I wanted. Looks like I should submit the whole change as a single patch?

Tridacnid updated this revision to Diff 263887.May 13 2020, 4:42 PM
gribozavr2 accepted this revision.Jun 3 2020, 12:04 AM

Nice find, thank you for the fix!

This revision is now accepted and ready to land.Jun 3 2020, 12:04 AM
njames93 accepted this revision.Jun 3 2020, 1:22 AM

LGTM, but I wouldn't say no to a test case using (Limit) -= 1.

Tridacnid updated this revision to Diff 268991.Jun 5 2020, 8:17 PM

Add (Limit) -= 1 test cases to bugprone-infinite-loop tests

Awesome. I don't have commit access, https://llvm.org/docs/Phabricator.html says I just need to ask here and someone will pick it up. Let me know if there's anything else I need to do. Thanks!

Awesome. I don't have commit access, https://llvm.org/docs/Phabricator.html says I just need to ask here and someone will pick it up. Let me know if there's anything else I need to do. Thanks!

I can commit on your behalf, but I'd need to know the email address you use for github.

tridacnid@gmail.com

https://github.com/Tridacnid

Thanks!

I've commited it on your behalf, would you be able to close the bug report.

This revision was automatically updated to reflect the committed changes.

Bug report has been closed. I'm seeing some build failures in my inbox but eyeballing them doesn't make me think this change is related. What is the expectation for me in this scenario? Will I get an email letting me know once the build has been fixed?

Bug report has been closed. I'm seeing some build failures in my inbox but eyeballing them doesn't make me think this change is related. What is the expectation for me in this scenario? Will I get an email letting me know once the build has been fixed?

If you get those emails often it means your patch was included in a bunch of patches where one caused the failed build, usually its obvious if your changes are causing the build failure. If it is your patch you will need to push a quick fix for it, or revert if it turns out to be more complicated (As you don't have commit access you can just ask someone else to do it for you). If someone else spots that a patch is causing build failures they may leave a comment in the review to point you in the right direction.
If you do decide to get commit access, its also a good idea to run ninja check-<component> before you push, with component being the part of the repo your patch touches, to reduce the chances of failures. In this case I ran check-clang and check-clang-tools, This isn't fool proof as some of the build slaves run of different platforms which have slight subtleties of how they handle certain things but will certainly increase your chance of success

I did run both of the testing targets you mentioned, but only on Linux. I'll keep an eye on the buildbot, thanks for the info!