Don't diagnose unused but set when the Cleanup attribute is used.
authorMichael Benfield <mbenfield@google.com>
Wed, 15 Sep 2021 22:57:41 +0000 (22:57 +0000)
committerMichael Benfield <mbenfield@google.com>
Wed, 22 Sep 2021 17:48:09 +0000 (17:48 +0000)
commitaf99236747872af7e77092cbf6ddd18fa8623a2f
tree646047ad0067a0ef649e570c451d73f8cad81fa9
parente828655313db901c733bf4bab6ac78c18833d765
Don't diagnose unused but set when the Cleanup attribute is used.

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

This addresses bug 51865.

Differential Revision: https://reviews.llvm.org/D109862
clang/lib/Sema/SemaDecl.cpp
clang/test/Sema/warn-unused-but-set-variables.c