]> granicus.if.org Git - clang/commitdiff
Clear temporaries in more places.
authorAnders Carlsson <andersca@mac.com>
Fri, 13 Nov 2009 20:11:49 +0000 (20:11 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 13 Nov 2009 20:11:49 +0000 (20:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88687 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp

index 247558b9c228337f070c4bfe5aa1e55d41ec2b0f..c3f3367d2d2b82b2f50f4b8412470dc1c2ab1585 100644 (file)
@@ -1293,6 +1293,9 @@ Sema::SetBaseOrMemberInitializers(CXXConstructorDecl *Constructor,
         
         MarkDeclarationReferenced(Constructor->getLocation(), Ctor);
         
+        // FIXME: CXXBaseOrMemberInitializer should only contain a single 
+        // subexpression so we can wrap it in a CXXExprWithTemporaries if necessary.
+        ExprTemporaries.clear();
         CXXBaseOrMemberInitializer *Member =
           new (Context) CXXBaseOrMemberInitializer(VBase->getType(),
                                                    CtorArgs.takeAs<Expr>(),
@@ -1343,6 +1346,9 @@ Sema::SetBaseOrMemberInitializers(CXXConstructorDecl *Constructor,
         
         MarkDeclarationReferenced(Constructor->getLocation(), Ctor);
 
+        // FIXME: CXXBaseOrMemberInitializer should only contain a single 
+        // subexpression so we can wrap it in a CXXExprWithTemporaries if necessary.
+        ExprTemporaries.clear();
         CXXBaseOrMemberInitializer *Member =
           new (Context) CXXBaseOrMemberInitializer(Base->getType(),
                                                    CtorArgs.takeAs<Expr>(),
@@ -1413,6 +1419,9 @@ Sema::SetBaseOrMemberInitializers(CXXConstructorDecl *Constructor,
                                   Constructor->getLocation(), CtorArgs))
         continue;
       
+      // FIXME: CXXBaseOrMemberInitializer should only contain a single 
+      // subexpression so we can wrap it in a CXXExprWithTemporaries if necessary.
+      ExprTemporaries.clear();
       CXXBaseOrMemberInitializer *Member =
         new (Context) CXXBaseOrMemberInitializer(*Field,CtorArgs.takeAs<Expr>(),
                                                  CtorArgs.size(), Ctor,