[PATCH] D88295: [Sema] Fix volatile check when test if a return object can be implicitly move

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 6 15:46:31 PST 2020


rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

In D88295#2365560 <https://reviews.llvm.org/D88295#2365560>, @Quuxplusone wrote:

>> So, how about we add another `CES` flag
>
> As the original author of `CES_AsIfByStdMove`, I am opposed to any attempt to complicate this patch. My medium-term goal, now that P1155 <https://reviews.llvm.org/P1155> has been adopted, is to //eliminate// the complexity around `-Wreturn-std-move` diagnostics. I want to be able to say, "This stuff got fixed in the paper standard and now Clang doesn't need to diagnose it anymore."

OK, I think that's reasonable. I don't think it's worth keeping `-Wreturn-std-move` around if the only time it ever fires is when returning a `volatile`-qualified local variable; it certainly does not pull its weight if it only diagnoses that situation. I'm happy with losing the diagnostic for that case now, especially if we intend to remove the warning entirely as a follow-up.

(The changes to `co_return` are a bugfix, so that seems fine. I'm not going to ask for a test for that change; it seems preferable to leave that to D68845 <https://reviews.llvm.org/D68845> or wherever we properly implement the copy-elision rules for `co_return`.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88295



More information about the cfe-commits mailing list