This doesn't seem like the right approach. The special case here is
`std::move`, not universal references that end up being lvalues.
================
Comment at: test/SemaCXX/warn-consumed-analysis.cpp:149
@@ +148,3 @@
+
+ var1 = move(var0);
+
----------------
The reason this consumes `var0` *isn't* because `var0` was passed to a `T&&`
(which was actually an lvalue reference), it's that inside `move`, the object
was cast to an rvalue reference and moved from.
Consider:
void f(ConsumableClass &does_not_consume);
template<typename ...T> void call_f(T &&...t) {
f(std::forward<T>(t)...);
}
void g() {
ConsumableClass x;
call_f(x); // does *not* consume x
consume(x); // ok
}
http://llvm-reviews.chandlerc.com/D2872
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits