Index: src/GenPoly/Lvalue.cpp
===================================================================
--- src/GenPoly/Lvalue.cpp	(revision e74809439d74c841d57da511260a6aad94c0c222)
+++ src/GenPoly/Lvalue.cpp	(revision 489d3ba602f6e02e57ae61a5328cf048be74914a)
@@ -316,8 +316,15 @@
 			Warning::RvalueToReferenceConversion, toCString( expr->arg ) );
 
+
+		// allowing conversion in the rvalue to const ref case
+		// use the referenced-to type to create temp variables
+		ast::Type const * targetType = dstType;
+		for (int i = 0; i < diff; ++i) targetType = (strict_dynamic_cast<ast::ReferenceType const *>(targetType))->base;
+
 		static UniqueName tmpNamer( "__ref_tmp_" );
 		ast::ObjectDecl * tmp = new ast::ObjectDecl( expr->arg->location,
 			tmpNamer.newName(),
-			ast::deepCopy( expr->arg->result ),
+			// ast::deepCopy( expr->arg->result ),
+			ast::deepCopy (targetType),
 			new ast::SingleInit( expr->arg->location, expr->arg ) );
 		PRINT( std::cerr << "make tmp: " << tmp << std::endl; )
