title: Can an optimizing compiler add std::move?
body: <p>Can a compiler do <strong>automatic lvalue-to-rvalue conversion</strong> if it can prove that the lvalue won't be used again?  Here's an example to clarify what I mean:</p>
  
  <pre><code>void Foo(vector&lt;int&gt; values) { ...}
  
  void Bar() {
    vector&lt;int&gt; my_values {1, 2, 3};
    Foo(my_values);  // may the compiler pretend I used std::move here?
  }
  </code></pre>
  
  <p>If a <code>std::move</code> is added to the commented line, then the vector can be moved into <code>Foo</code>'s parameter, rather than copied.  However, as written, I didn't use <code>std::move</code>.  </p>
  
  <p>It's pretty easy to statically prove that my_values won't be used after the commented line.  So s the compiler allowed to move the vector, or is it required to copy it?</p>