mirror of
https://github.com/google/googletest.git
synced 2024-12-27 10:11:03 +08:00
Prevent using ReturnRef on reference to temporary
Fixed issue: 2471
This commit is contained in:
parent
f966ed1581
commit
b11fb80e9e
@ -1022,6 +1022,10 @@ inline internal::ReturnRefAction<R> ReturnRef(R& x) { // NOLINT
|
||||
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
|
||||
// argument. The copy is created when the action is constructed and
|
||||
// lives as long as the action.
|
||||
|
Loading…
x
Reference in New Issue
Block a user