Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
b11fb80e
Commit
b11fb80e
authored
Oct 22, 2019
by
Piotr Nycz
Browse files
Prevent using ReturnRef on reference to temporary
Fixed issue: 2471
parent
f966ed15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
googlemock/include/gmock/gmock-actions.h
googlemock/include/gmock/gmock-actions.h
+4
-0
No files found.
googlemock/include/gmock/gmock-actions.h
View file @
b11fb80e
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment