Closed xmh0511 closed 1 year ago
I think the wording in the standard is clear here, so I can't see a defect. Did C++98 say the same thing? I think it did, although we didn't have "discarded-value expressions" back then.
I think the wording in the standard is clear here, so I can't see a defect. Did C++98 say the same thing? I think it did, although we didn't have "discarded-value expressions" back then.
I think the wording is clear enough. The question is that all implementations do not support this feature. See the linked issue.
CWG1383 made it clear (by adding a note) what the committee intended:
Discarded-value expressions apply to class types, which will be ill-formed if there is no volatile copy constructor with which to initialize the temporary.
I think CWG has spoken on this issue, and a change in direction (even if motivated by a deliberate choice of non-conformance by implementations) needs a paper to EWG.
I think the wording in the standard is clear here, so I can't see a defect. Did C++98 say the same thing? I think it did, although we didn't have "discarded-value expressions" back then.
The wording was originally added by CWG1054. Anyway, I don't think we should revert it.
Full name of submitter (unless configured in github; will be published with the issue): Jim X
According to [expr.context] p2 and [conv.lval] p3, the invocation of the constructor
A(A volatile&)
should be observable. However, no major implementations do this.I tried to open an issue for Clang and the feedback is
Relevant issue https://github.com/llvm/llvm-project/issues/52999.
Suggested Resolution
Do we need to insist on this feature or change the relevant wording to match the behavior of implementations?