This is an archive of the discontinued LLVM Phabricator instance.

Prevent abseil-cleanup-ctad check from stomping on surrounding context
ClosedPublic

Authored by CJ-Johnson on Dec 9 2021, 9:15 AM.

Details

Summary

This change applies two fixes to the abseil-cleanup-ctad check. It uses hasSingleDecl() to ensure only declStmt()s with one varDecl() are matched (leaving compount declStmt()s unchanged). It also addresses a bug in the handling of comments that surround the absl::MakeCleanup() calls by switching to the callArgs() combinator from Clang Transformer.

Diff Detail

Event Timeline

CJ-Johnson created this revision.Dec 9 2021, 9:15 AM
CJ-Johnson requested review of this revision.Dec 9 2021, 9:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 9 2021, 9:15 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ymandel accepted this revision.Dec 9 2021, 9:20 AM

Nice!

This revision is now accepted and ready to land.Dec 9 2021, 9:20 AM
This revision was landed with ongoing or failed builds.Dec 9 2021, 9:41 AM
This revision was automatically updated to reflect the committed changes.