[cfe-dev] Use-after-move warning?

David Chisnall David.Chisnall at cl.cam.ac.uk
Tue Oct 7 01:00:44 PDT 2014


On 6 Oct 2014, at 21:39, David Blaikie <dblaikie at gmail.com> wrote:

> I doubt it's reliable enough to warn on that generally - the user might've wanted to return an empty value in that situation. (think of the case where T is std::unique_ptr, with a well defined move-from state that users might rely on).

I think that the number of times that I've used that pattern is a tiny handful of the times where I've used std::move, so perhaps an attribute to flag that 'yes, I really meant to return this value even though it's now empty' is the way forward? 

David





More information about the cfe-dev mailing list