This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix DanglingHandleCheck to work in C++17 and later mode
ClosedPublic

Authored by loskutov on Aug 20 2023, 11:22 AM.

Details

Summary

Due to guaranteed copy elision, not only do some nodes get removed from the AST,
but also some existing nodes change the source locations they correspond to.
Hence, the check works slightly differently in pre-C++17 and C++17-and-later modes
in terms of what gets highlighted.

Diff Detail

Event Timeline

loskutov created this revision.Aug 20 2023, 11:22 AM
Herald added a project: Restricted Project. · View Herald Transcript
loskutov requested review of this revision.Aug 20 2023, 11:22 AM
loskutov updated this revision to Diff 552164.Aug 21 2023, 4:44 PM

git clang-format

PiotrZSL accepted this revision.Aug 26 2023, 1:05 AM

Overall looks to be fine, but I didn't get too deep into AST matchers.
I assume that tests cover them.
Please wait like 2 weeks before pushing this, so someone else could be able to verify this if they need.

This revision is now accepted and ready to land.Aug 26 2023, 1:05 AM

Please wait like 2 weeks before pushing this, so someone else could be able to verify this if they need.

It's been 2 weeks, so I guess nothing prevents from getting this change merged. However, I don't have push access to the repo, so could you commit the change?

However, I don't have push access to the repo, so could you commit the change?

Name / Email (to be used as author) ?

Name / Email (to be used as author) ?

Ignat Loskutov <ignat.loskutov@gmail.com>