Skip to content

Commit c5a13e2

Browse files
committed
[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
1 parent 4dbe2db commit c5a13e2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/CodeGen/EHScopeStack.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ class EHScopeStack {
278278
CGF(nullptr) {}
279279
~EHScopeStack() { delete[] StartOfBuffer; }
280280

281+
EHScopeStack(const EHScopeStack &) = delete;
282+
EHScopeStack &operator=(const EHScopeStack &) = delete;
283+
281284
/// Push a lazily-created cleanup on the stack.
282285
template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
283286
static_assert(alignof(T) <= ScopeStackAlignment,

0 commit comments

Comments
 (0)