-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[Clang] Deducing this does not work correctly with move-only types. #100341
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
Comments
@llvm/issue-subscribers-clang-frontend Author: None (slavek-kucera)
Move only types have to be explicitly cast to r-value for the move constructor to be used. https://godbolt.org/z/fabdhKKEj
|
possible duplicate of #100314 @MitalAshok |
I don't think this is a dupe, since even without CWG2813 this should have been accepted. |
Problem was here: llvm-project/clang/lib/Sema/SemaOverload.cpp Line 6359 in 2e57e63
The temporary was treated as an lvalue if the explicit object parameter was by-value or an lvalue reference type, and is only an xvalue if it had an rvalue reference type (including |
…0223) This is a rebase of llvm#95112 with my own feedback apply as @MitalAshok has been inactive for a while. It's fairly important this makes clang 20 as it is a blocker for llvm#107451 Change-Id: I2261810f7c8d7dd8b3e3412c0814a528d7c7b91c --- [CWG2813](https://cplusplus.github.io/CWG/issues/2813.html) prvalue.member_fn(expression-list) now will not materialize a temporary for prvalue if member_fn is an explicit object member function, and prvalue will bind directly to the object parameter. The E1 in E1.static_member is now a discarded-value expression, so if E1 was a call to a [[nodiscard]] function, there will now be a warning. This also affects C++98 with [[gnu::warn_unused_result]] functions. This should not affect C where TemporaryMaterializationConversion is a no-op. Closes llvm#100314 Fixes llvm#100341 --------- Co-authored-by: Mital Ashok <[email protected]> (cherry picked from commit db93ef1) Change-Id: Ic277d16bc8611b9d383cb890da3eda0ef1646555
Move only types have to be explicitly cast to r-value for the move constructor to be used. https://godbolt.org/z/fabdhKKEj
The text was updated successfully, but these errors were encountered: