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

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 6 09:03:47 PST 2020


Quuxplusone added a comment.

I've found another case that Clang has never handled correctly (and which your patch does not fix)—
https://godbolt.org/z/xd8qGW

  struct Widget {};
  struct Frodo {
      Frodo(Widget&);
      Frodo(Widget&&) = delete;
  };
  
  Frodo twelve() {
      Widget w;
      return w;  // according to the majority of vendors, the first pass should not "fail";
                 // it should successfully find the deleted overload and hard-error at that point.
                 // This has been the case ever since C++11, AFAIK.
  }

This example will be mentioned in my upcoming (not-yet-finished) WG21 paper P2266 <https://wg21.link/p2266>, as an example of why the two-pass mechanism sucks and should be removed from C++2b.


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