title: Ambiguous call with overloaded r-value reference function
body: <p>I have a class with the following declarations:</p>
  
  <pre><code>class IcoSphere
  {
  [...]
  private:
      int _addVertex(const glm::vec3 &amp;p);
      int addVertex(glm::vec3 p);
      int addVertex(const glm::vec3 &amp;&amp;p);
  [...]
  };
  </code></pre>
  
  <p>Then, I'm calling 'addVertex' like so:</p>
  
  <pre><code>IcoSphere sphere;
  double t = (1.0 +sqrt(5.0)) /2.0;
  sphere.addVertex(glm::vec3(-1,t,0));
  </code></pre>
  
  <p>The argument for 'addVertex' is obviously not a reference, and yet the g++-compiler throws the following error:</p>
  
  <pre><code>./network/icosphere.cpp: In static member function ‘static void IcoSphere::Create(glm::vec3&amp;, float, std::vector&lt;glm::tvec3&lt;float, (glm::precision)0u&gt; &gt;&amp;, int)’:
  ./network/icosphere.cpp:46:36: error: call of overloaded ‘addVertex(glm::vec3)’ is ambiguous
    sphere.addVertex(glm::vec3(-1,t,0));
                                      ^
  ./network/icosphere.cpp:46:36: note: candidates are:
  ./network/icosphere.cpp:19:5: note: int IcoSphere::addVertex(glm::vec3)
   int IcoSphere::addVertex(glm::vec3 p) {_addVertex(p);}
       ^
  ./network/icosphere.cpp:20:5: note: int IcoSphere::addVertex(const vec3&amp;&amp;)
   int IcoSphere::addVertex(const glm::vec3 &amp;&amp;p) {_addVertex(p);}
       ^
  </code></pre>
  
  <p>This doesn't make a whole lot of sense to me, why is it considering it an ambiguous call?</p>