[PATCH] Re-adding the isSpelledAsLValue check in Consumed analysis
Richard Smith
richard at metafoo.co.uk
Mon Feb 24 16:28:47 PST 2014
There's no way in general to know whether a function that takes a `T &` consumes it, other than by inspecting its implementation. I believe the conservatively-correct thing to do is to assume that such functions do not consume, and that's what we already do here.
If we have attributes to allow people to annotate their custom `move` implementations, I think our position is already reasonable here. Maybe we could add a warning when analysis of the implementation of a function determines that it consumes one of its by-lvalue-reference parameters and it lacks the attribute?
http://llvm-reviews.chandlerc.com/D2872
More information about the cfe-commits
mailing list