File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,9 @@ class ScopeCreator final {
168
168
169
169
ScopeCreator (SourceFile *SF)
170
170
: ctx(SF->getASTContext ()),
171
- sourceFileScope(new (ctx) ASTSourceFileScope(SF, this )) {}
171
+ sourceFileScope(new (ctx) ASTSourceFileScope(SF, this )) {
172
+ ctx.addDestructorCleanup (scopedNodes);
173
+ }
172
174
173
175
ScopeCreator (const ScopeCreator &) = delete; // ensure no copies
174
176
ScopeCreator (const ScopeCreator &&) = delete; // ensure no moves
@@ -660,8 +662,6 @@ class ScopeCreator final {
660
662
661
663
// Make vanilla new illegal for ASTScopes.
662
664
void *operator new (size_t bytes) = delete ;
663
- // Need this because have virtual destructors
664
- void operator delete (void *data) {}
665
665
666
666
// Only allow allocation of scopes using the allocator of a particular source
667
667
// file.
You can’t perform that action at this time.
0 commit comments