https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87150
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|SUSPENDED |ASSIGNED --- Comment #12 from Marek Polacek <mpolacek at gcc dot gnu.org> --- (In reply to Jason Merrill from comment #11) > (In reply to Stephan Bergmann from comment #9) > > (In reply to Marek Polacek from comment #8) > > > It appears that the sentiment is that this testcase should actually be > > > valid > > > > Do you have a reference for that? The reason for this not to be valid, > > presented at the bottom of > > <http://lists.llvm.org/pipermail/cfe-dev/2018-August/059190.html> "Re: > > [cfe-dev] return lvalue move instead of copy?" looks rather convincing to > > me. > > (Namely, slicing by move leaving the object in a partially-moved state that > might not maintain invariants.) > > That's a good point. I guess the rule we're looking for will still require > that the returned object being treated as an xvalue be bound to some rvalue > reference to the whole object, rather than a base subobject. > > So Marek, please go ahead and apply your patch after all. Will do. > And similarly, > maybe refine your 87109 patch to only reject the conversion function if it > comes from a base class. I'll send a patch to the ML, I don't feel like committing that without a review.