Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision b56c17c82c91bea9e2dea63f29f173e29b11f951)
+++ src/InitTweak/FixInit.cc	(revision 3aeaecd045fc36d8a618c00f85faaf42de32c104)
@@ -404,5 +404,5 @@
 			result = result->clone();
 			env->apply( result );
-			ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
+			ObjectDecl * tmp = ObjectDecl::newObject( "__tmp", result, nullptr );
 			tmp->get_type()->set_const( false );
 
@@ -418,4 +418,7 @@
 				if ( function->get_var()->get_linkage() == LinkageSpec::Intrinsic ) return;
 			}
+
+			// set a unique name for the temporary once it's certain the call is necessary
+			tmp->name = tempNamer.newName();
 
 			// replace argument to function call with temporary
@@ -447,10 +450,10 @@
 				result = result->clone();
 				env->apply( result );
-				ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
+				ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr );
 				ret->get_type()->set_const( false );
 				impCpCtorExpr->get_returnDecls().push_back( ret );
 				CP_CTOR_PRINT( std::cerr << "makeCtorDtor for a return" << std::endl; )
 				if ( ! dynamic_cast< ReferenceType * >( result ) ) {
-					// destructing lvalue returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary
+					// destructing reference returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary
 					destructRet( ret, impCpCtorExpr );
 				}
@@ -469,5 +472,5 @@
 				result = result->clone();
 				env->apply( result );
-				ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
+				ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr );
 				ret->get_type()->set_const( false );
 				stmtExpr->get_returnDecls().push_front( ret );
@@ -506,5 +509,5 @@
 			} else {
 				// expr isn't a call expr, so create a new temporary variable to use to hold the value of the unique expression
-				unqExpr->set_object( new ObjectDecl( toString("_unq", unqExpr->get_id()), Type::StorageClasses(), LinkageSpec::C, nullptr, unqExpr->get_result()->clone(), nullptr ) );
+				unqExpr->set_object( ObjectDecl::newObject( toString("_unq", unqExpr->get_id()), unqExpr->get_result()->clone(), nullptr ) );
 				unqExpr->set_var( new VariableExpr( unqExpr->get_object() ) );
 			}
@@ -1149,5 +1152,5 @@
 
 			// xxx - ideally we would reuse the temporary generated from the copy constructor passes from within firstArg if it exists and not generate a temporary if it's unnecessary.
-			ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, nullptr, ctorExpr->get_result()->clone(), nullptr );
+			ObjectDecl * tmp = ObjectDecl::newObject( tempNamer.newName(), ctorExpr->get_result()->clone(), nullptr );
 			addDeclaration( tmp );
 
