title: C++ Pass by value with perfect rvalues
body: <p>This might just be a "vocabulary issue", but there is something I don't get with rvalue references and pass by value.</p>
  
  <p>If I have a code like this (<a href="https://ideone.com/uz4Smw" rel="nofollow noreferrer">ideone it</a>)</p>
  
  <pre><code>struct Foo
  {
      Foo()                 { printf("Ctor\n"); }
      Foo(const Foo&amp; other) { printf("Copy\n"); }
      Foo(Foo&amp;&amp; other)      { printf("Move\n"); }
      ~Foo()                { printf("Dtor\n"); }
  };
  
  void DoFoo(Foo foo) { printf("Foo\n"); }
  
  int main()
  {
      Foo foo;
      DoFoo(foo);
      DoFoo(Foo{});
      return 0;
  }
  </code></pre>
  
  <p>it will give me this output (<a href="https://ideone.com/uz4Smw" rel="nofollow noreferrer">ideone result</a> copy pasted)</p>
  
  <pre><code>Ctor 0x96eaa10 0
  Copy 0x96eaa20 0
  Foo  0x96eaa20 0
  Dtor 0x96eaa20
  Ctor 0x96eaa20 1
  Foo  0x96eaa20 1
  Dtor 0x96eaa20
  Dtor 0x96eaa10
  </code></pre>
  
  <p>What I don't understand is, according to many stackoverflow answers, like <a href="https://stackoverflow.com/a/7592741/4717805">here</a> or <a href="https://stackoverflow.com/a/9724935/4717805">here</a>, the <em>move constructor</em> should be called for the <code>DoFoo(Foo{})</code>, but it's clearly not, and the behaviour is the same with or without a <code>Foo</code> <em>move constructor</em>. </p>
  
  <p>Even replacing <code>DoFoo(Foo foo)</code> by <code>DoFoo(Foo&amp;&amp; foo)</code> does not force the call to the <em>move constructor</em>. </p>
  
  <p>So, is it just a vocabulary issue when using <em>moved</em> in these particular case ? Is it a GCC particular behaviour? or anything else ?</p>