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
[class.copy.elision] p2 incorrect comment in copy elision example #4926
Comments
Agree that comment is not correct. Since both [class.copy.elision]p1 and [expr.const] p1 says
Hence, for |
There is no temporary here; the result of |
There can have a temporary here. |
Good point. I think the pull request is correct regardless, because c.p will be dangling at the end either way. |
Paragraph 2 of [class.copy.elision] (https://eel.is/c++draft/class.copy.elision#2) contains the following example:
I believe the comment "well-formed, c.p may point to c or to an ephemeral temporary" is not entirely correct, because there is no temporary in this scenario.
This comment was originally added with the resolution of CWG2002. The example used in that resolution was:
In this resolution the comment "well-formed, c.p may point to c or to an ephemeral temporary" correctly reflects the code.
After the resolution of CWG2002 the code in the example was modified in 95321805a3, but the comment was not changed to reflect this.
The text was updated successfully, but these errors were encountered: