Skip to content

Commit a4fc5f3

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents 075acb0 + 0c9bfaa commit a4fc5f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/AST/ASTScopeCreation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ class ScopeCreator final {
168168

169169
ScopeCreator(SourceFile *SF)
170170
: ctx(SF->getASTContext()),
171-
sourceFileScope(new (ctx) ASTSourceFileScope(SF, this)) {}
171+
sourceFileScope(new (ctx) ASTSourceFileScope(SF, this)) {
172+
ctx.addDestructorCleanup(scopedNodes);
173+
}
172174

173175
ScopeCreator(const ScopeCreator &) = delete; // ensure no copies
174176
ScopeCreator(const ScopeCreator &&) = delete; // ensure no moves
@@ -660,8 +662,6 @@ class ScopeCreator final {
660662

661663
// Make vanilla new illegal for ASTScopes.
662664
void *operator new(size_t bytes) = delete;
663-
// Need this because have virtual destructors
664-
void operator delete(void *data) {}
665665

666666
// Only allow allocation of scopes using the allocator of a particular source
667667
// file.

0 commit comments

Comments
 (0)