Handle destruction of temporaries used in default argument
construction of constructor calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78222 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index a92f7f4..445cd69 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -179,6 +179,7 @@
Init = BuildCXXConstructExpr(Context,
DeclType, Constructor, false, &Init, 1);
+ Init = MaybeCreateCXXExprWithTemporaries(Init, /*DestroyTemps=*/true);
return false;
}