aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCXXTemp.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-06-16 03:37:31 +0000
committerAnders Carlsson <andersca@mac.com>2009-06-16 03:37:31 +0000
commitf54741e6465692d3bdbae974ac3beeeab92e4a95 (patch)
tree1b7100f044e74fc9da1164e514b784b5285b5850 /lib/CodeGen/CGCXXTemp.cpp
parent76e4ce42a30cee4dc40ce7c6014874fbc4f9baa7 (diff)
Handle temporaries in default arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXXTemp.cpp')
-rw-r--r--lib/CodeGen/CGCXXTemp.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCXXTemp.cpp b/lib/CodeGen/CGCXXTemp.cpp
index 141726a649..a6e6d11505 100644
--- a/lib/CodeGen/CGCXXTemp.cpp
+++ b/lib/CodeGen/CGCXXTemp.cpp
@@ -85,6 +85,11 @@ RValue
CodeGenFunction::EmitCXXExprWithTemporaries(const CXXExprWithTemporaries *E,
llvm::Value *AggLoc,
bool isAggLocVolatile) {
+ // If we shouldn't destroy the temporaries, just emit the
+ // child expression.
+ if (!E->shouldDestroyTemporaries())
+ return EmitAnyExpr(E->getSubExpr(), AggLoc, isAggLocVolatile);
+
// Keep track of the current cleanup stack depth.
size_t CleanupStackDepth = CleanupEntries.size();
(void) CleanupStackDepth;