-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Prevent using ReturnRef on reference to temporary #2527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent using ReturnRef on reference to temporary #2527
Conversation
Fixed issue: 2471
|
Please include a test that triggers the bug and gets fixed with this change. |
|
How is he going to test non-compiling code? It isn't run-time. |
|
You can use Example: |
|
Ah, ok. I know this trick. Though I think the standard way of doing this is by using |
void_t is not available in C++11, but you can do without it too. |
You are right. The difference is between basic (integral) types and more complex classes. I'll change that (the names). |
IMHO |
I see it as a different way of asking the same question. |
Ok, I'll remove HasReturnRefAction with next commit. |
Issue 2527
|
Do we really need 6 commits for that? :D I suggest squashing them all into one. |
|
Thank you, we have started internal review. Please don't push any more changes into this PR as they might be overwritten. |
…tore_temporaries_2 PiperOrigin-RevId: 277061341
…tore_temporaries_2 PiperOrigin-RevId: 277061341
…tore_temporaries_2 PiperOrigin-RevId: 277061341
Fixed issue: 2471