This is an archive of the discontinued LLVM Phabricator instance.

Don't diagnose unused but set when the Cleanup attribute is used.
ClosedPublic

Authored by mbenfield on Sep 15 2021, 4:47 PM.

Details

Summary

This applies to -Wunused-but-set-variable and
-Wunused-but-set-parameter.

This addresses bug 51865.

Diff Detail

Event Timeline

mbenfield requested review of this revision.Sep 15 2021, 4:47 PM
mbenfield created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 15 2021, 4:47 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman added a subscriber: aaron.ballman.

I think this is reasonable, but it's missing test coverage. Can you add some tests to clang/test/Sema to demonstrate that we purposefully do not issue a diagnostic when the cleanup attribute is used?

mbenfield updated this revision to Diff 373069.Sep 16 2021, 2:18 PM

Added a test case.

aaron.ballman accepted this revision.Sep 17 2021, 8:37 AM

LGTM, thank you!

This revision is now accepted and ready to land.Sep 17 2021, 8:37 AM