[PATCH] D88220: [C++20] P1825R0: More implicit moves

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 1 21:55:24 PST 2020


Quuxplusone added a subscriber: david_stone.
Quuxplusone added inline comments.


================
Comment at: clang/test/CXX/class/class.init/class.copy.elision/p3.cpp:22
+  return c;
+}
+#else
----------------
@rsmith @david_stone (or anyone), what is the status in C++20 of the following test case?

    C&& test(C&& c) {
        return c;
    }

I know we talked about this in person at CppCon 2018, and concluded that our //intention// was for this to be legal, but that it wasn't actually legal as-worded, because the returned thingie here is not an object but rather a reference, and therefore none of [P1825's](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1825r0.html) wording actually covers it. Is that still the case? Is there an open issue about this? Is there any appetite for Clang to just go ahead and //make// this legal?  (The current patch does //not// make this legal.)

Relevant reading: https://quuxplusone.github.io/blog/2018/09/25/perfect-backwarding/


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88220/new/

https://reviews.llvm.org/D88220



More information about the cfe-commits mailing list