Prevent using ReturnRef on reference to temporary
Fixed issue: 2471
This commit is contained in:
		@@ -1022,6 +1022,10 @@ inline internal::ReturnRefAction<R> ReturnRef(R& x) {  // NOLINT
 | 
				
			|||||||
  return internal::ReturnRefAction<R>(x);
 | 
					  return internal::ReturnRefAction<R>(x);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Prevent using ReturnRef on reference to temporary.
 | 
				
			||||||
 | 
					template <typename R>
 | 
				
			||||||
 | 
					internal::ReturnRefAction<R> ReturnRef(R&&) = delete;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Creates an action that returns the reference to a copy of the
 | 
					// Creates an action that returns the reference to a copy of the
 | 
				
			||||||
// argument.  The copy is created when the action is constructed and
 | 
					// argument.  The copy is created when the action is constructed and
 | 
				
			||||||
// lives as long as the action.
 | 
					// lives as long as the action.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user