This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix `readability-suspicious-call-argument` crash for arguments without name-like identifier
ClosedPublic

Authored by whisperity on Feb 25 2022, 5:25 AM.

Details

Summary

As originally reported by @steakhal in #54074, the name extraction logic in readability-suspicious-call-argument crashes if the argument passed to a function was a function call to a non-trivially named entity (e.g. an operator).

Fixed this crash case by ignoring such constructs and considering them as having no name.

Diff Detail

Event Timeline

whisperity created this revision.Feb 25 2022, 5:25 AM
whisperity requested review of this revision.Feb 25 2022, 5:25 AM

Reasonable to me.

aaron.ballman accepted this revision.Feb 25 2022, 6:11 AM

LGTM, please add a release note for the fix.

This revision is now accepted and ready to land.Feb 25 2022, 6:11 AM

LGTM, please add a release note for the fix.

That being said, should backport this to clang-14? @aaron.ballman

LGTM, please add a release note for the fix.

That being said, should backport this to clang-14? @aaron.ballman

I think it's safe enough for that.

Added Release notes entry.

This revision was landed with ongoing or failed builds.Feb 25 2022, 7:25 AM
This revision was automatically updated to reflect the committed changes.

Thanks! I'll re-run the tests on top of 14.0 and do the backport too, soon. 🙂

Thanks! I'll re-run the tests on top of 14.0 and do the backport too, soon. 🙂

If you backport, the release notes change on trunk should then be reverted.

If you backport, the release notes change on trunk should then be reverted.

Indeed, this is not the first time I mess this up... Ugh.
I'll wait a little bit for that to make sure the backport is stable, and then I will revert that part of the change.

If you backport, the release notes change on trunk should then be reverted.

Release Notes entry of current development tree reverted in rG94850918274c20c15c6071dc52314df51ed2a357.