From c5a13e2c7e4c1769831c99ff2bf9f3690328c3d4 Mon Sep 17 00:00:00 2001 From: "Podchishchaeva, Mariya" Date: Tue, 25 Jul 2023 02:32:16 -0700 Subject: [PATCH] [NFC][clang] Fix static analyzer concerns EHScopeStack doesn't seem to be intended for copy. It frees memory in the destructor and doesn't have user-written copy c'tor and assignment operator, so delete them to avoid using default ones which would do wrong. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D156133 --- clang/lib/CodeGen/EHScopeStack.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/lib/CodeGen/EHScopeStack.h b/clang/lib/CodeGen/EHScopeStack.h index 4893689..3c8a515 100644 --- a/clang/lib/CodeGen/EHScopeStack.h +++ b/clang/lib/CodeGen/EHScopeStack.h @@ -278,6 +278,9 @@ public: CGF(nullptr) {} ~EHScopeStack() { delete[] StartOfBuffer; } + EHScopeStack(const EHScopeStack &) = delete; + EHScopeStack &operator=(const EHScopeStack &) = delete; + /// Push a lazily-created cleanup on the stack. template void pushCleanup(CleanupKind Kind, As... A) { static_assert(alignof(T) <= ScopeStackAlignment, -- 2.7.4