[clang] c5a13e2 - [NFC][clang] Fix static analyzer concerns

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 25 02:44:05 PDT 2023


Author: Podchishchaeva, Mariya
Date: 2023-07-25T02:43:41-07:00
New Revision: c5a13e2c7e4c1769831c99ff2bf9f3690328c3d4

URL: https://github.com/llvm/llvm-project/commit/c5a13e2c7e4c1769831c99ff2bf9f3690328c3d4
DIFF: https://github.com/llvm/llvm-project/commit/c5a13e2c7e4c1769831c99ff2bf9f3690328c3d4.diff

LOG: [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

Added: 
    

Modified: 
    clang/lib/CodeGen/EHScopeStack.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/EHScopeStack.h b/clang/lib/CodeGen/EHScopeStack.h
index 4893689f856ea3..3c8a51590d1b53 100644
--- a/clang/lib/CodeGen/EHScopeStack.h
+++ b/clang/lib/CodeGen/EHScopeStack.h
@@ -278,6 +278,9 @@ class EHScopeStack {
       CGF(nullptr) {}
   ~EHScopeStack() { delete[] StartOfBuffer; }
 
+  EHScopeStack(const EHScopeStack &) = delete;
+  EHScopeStack &operator=(const EHScopeStack &) = delete;
+
   /// Push a lazily-created cleanup on the stack.
   template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
     static_assert(alignof(T) <= ScopeStackAlignment,


        


More information about the cfe-commits mailing list