title: Call of overload is ambigious
body: <p>I am learning new C++ semantics and I got an error with this program:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;utility&gt;
  
  std::string foo(std::string str)
  {
      return str + " call from normal";
  }
  
  std::string foo(const std::string&amp; str)
  {
      return str + " call from normal";
  }
  
  std::string foo(std::string&amp;&amp; str)
  {
       return str + " call from ref ref";
  }
  
  int main()
  {
      std::string str = "Hello World!";
      std::string res = foo(str);
      std::string&amp;&amp; res_ref = foo(std::move(str));
      std::cout &lt;&lt; "Res ref = " &lt;&lt; res_ref &lt;&lt; std::endl;
      std::cout &lt;&lt; "Str = " &lt;&lt; str &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>The error is:</p>
  
  <blockquote>
  <pre><code>:23:30: error: call of overloaded ‘foo(std::__cxx11::string&amp;)’ is ambiguous
      std::string res = foo(str);
  </code></pre>
  </blockquote>
  
  <p>Why is the call ambiguous?</p>