Index: src/Common/SemanticError.h
===================================================================
--- src/Common/SemanticError.h	(revision 6470882cecaafc3d665ea875eb7d9961e217e20f)
+++ src/Common/SemanticError.h	(revision ec6c0404bf8b8104c482a89066bbe8acec0e8d23)
@@ -38,8 +38,10 @@
 constexpr const char * const WarningFormats[] = {
 	"self assignment of expression: %s",
+	"rvalue to reference conversion",
 };
 
 enum class Warning {
 	SelfAssignment,
+	RvalueToReferenceConversion,
 	NUMBER_OF_WARNINGS, //This MUST be the last warning
 };
@@ -50,5 +52,6 @@
 );
 
-#define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id], __VA_ARGS__)
+// ## used here to allow empty __VA_ARGS__
+#define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id], ## __VA_ARGS__)
 
 void SemanticWarningImpl (CodeLocation loc, Warning warn, const char * const fmt, ...) __attribute__((format(printf, 3, 4)));
Index: src/GenPoly/Lvalue.cc
===================================================================
--- src/GenPoly/Lvalue.cc	(revision 6470882cecaafc3d665ea875eb7d9961e217e20f)
+++ src/GenPoly/Lvalue.cc	(revision ec6c0404bf8b8104c482a89066bbe8acec0e8d23)
@@ -296,4 +296,5 @@
 				//   int && __ref_tmp_2 = &__ref_tmp_1;
 				//   &__ref_tmp_2;
+				SemanticWarning( castExpr->arg->location, Warning::RvalueToReferenceConversion );
 
 				static UniqueName tempNamer( "__ref_tmp_" );
