Index: src/InitTweak/GenInit.cc
===================================================================
--- src/InitTweak/GenInit.cc	(revision a61ad31375e748db470d1432e85336461752723c)
+++ src/InitTweak/GenInit.cc	(revision c6976ba09dbc5ab56dc1e9bf723a722048efdd57)
@@ -54,5 +54,5 @@
 
 	  protected:
-		FunctionType * ftype;
+		FunctionType * ftype = nullptr;
 		std::string funcName;
 	};
@@ -138,13 +138,11 @@
 		std::list< DeclarationWithType * > & returnVals = ftype->get_returnVals();
 		assert( returnVals.size() == 0 || returnVals.size() == 1 );
-		// hands off if the function returns an lvalue - we don't want to allocate a temporary if a variable's address
+		// hands off if the function returns a reference - we don't want to allocate a temporary if a variable's address
 		// is being returned
-		if ( returnStmt->get_expr() && returnVals.size() == 1 && ! returnVals.front()->get_type()->get_lvalue() ) {
+		if ( returnStmt->get_expr() && returnVals.size() == 1 && ! dynamic_cast< ReferenceType * >( returnVals.front()->get_type() ) ) {
 			// explicitly construct the return value using the return expression and the retVal object
 			assertf( returnVals.front()->get_name() != "", "Function %s has unnamed return value\n", funcName.c_str() );
-			UntypedExpr *construct = new UntypedExpr( new NameExpr( "?{}" ) );
-			construct->get_args().push_back( new AddressExpr( new VariableExpr( returnVals.front() ) ) );
-			construct->get_args().push_back( returnStmt->get_expr() );
-			stmtsToAddBefore.push_back(new ExprStmt(noLabels, construct));
+
+			stmtsToAddBefore.push_back( genCtorDtor( "?{}", dynamic_cast< ObjectDecl *>( returnVals.front() ), returnStmt->get_expr() ) );
 
 			// return the retVal object
@@ -213,4 +211,6 @@
 
 	bool CtorDtor::isManaged( Type * type ) const {
+		// at least for now, references are never constructed
+		if ( dynamic_cast< ReferenceType * >( type ) ) return false;
 		// need to clear and reset qualifiers when determining if a type is managed
 		ValueGuard< Type::Qualifiers > qualifiers( type->get_qualifiers() );
