[PATCH] D99005: [clang] Implement P2266 Simpler implicit move

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 28 08:24:44 PDT 2021


mizvekov added a comment.

In D99005#2844332 <https://reviews.llvm.org/D99005#2844332>, @zahiraam wrote:

> This change has made this snippet fail.
> https://godbolt.org/z/3ehK784hY Pass
> https://godbolt.org/z/9q48WvsP7 fails.

Hello!
That is expected breakage from the changes proposed in P2266 <https://reviews.llvm.org/P2266>.
With simpler implicit move, we no longer have a fallback second overload resolution where the return expression would be an l-value and would thus bind to that non-const copy constructor.
You can work that around by introducing an explicit cast to lvalue reference, like this: https://godbolt.org/z/EhYbhYjch

But is this example a reduction from a real world code base?
The committee wants feedback and we are interested how hard you believe this change affects you.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99005



More information about the cfe-commits mailing list