[NFC][clang] Fix static analyzer concerns

DelegatingDeserializationListener frees resources in the destructor but doesn't
have user-written copy c'tor or assignment operator, so copying it using
default ones can cause double free.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D156405
This commit is contained in:
Podchishchaeva, Mariya
2023-07-28 05:27:26 -07:00
parent bacc7aebb9
commit a623f4c784

View File

@@ -61,6 +61,11 @@ public:
delete Previous;
}
DelegatingDeserializationListener(const DelegatingDeserializationListener &) =
delete;
DelegatingDeserializationListener &
operator=(const DelegatingDeserializationListener &) = delete;
void ReaderInitialized(ASTReader *Reader) override {
if (Previous)
Previous->ReaderInitialized(Reader);