Destroy expressions properly when resizing an initializer list
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67417 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 2f7e363..fd1092f 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -341,7 +341,7 @@
void InitListExpr::resizeInits(ASTContext &Context, unsigned NumInits) {
for (unsigned Idx = NumInits, LastIdx = InitExprs.size();
Idx < LastIdx; ++Idx)
- delete InitExprs[Idx];
+ InitExprs[Idx]->Destroy(Context);
InitExprs.resize(NumInits, 0);
}