title: Is function overloading by reference allowed when there is no ambiguity?
body: <p>Consider following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  void foo(int m);
  void foo(int &amp;k);
  
  int main()
  {
      foo(5); // ok, because there is no ambiguity
  
      int m = 5;
      //foo(m); // compile-time error, because of ambiguity
      foo(m + 0); // ok, because it's an expression of type int and not object's lvalue
  }
  
  void foo(int m)
  {
      std::cout &lt;&lt; "by value\n";
  }
  void foo(int &amp;k)
  {
      std::cout &lt;&lt; "by reference\n";
  }
  </code></pre>
  
  <p>I understand that it introduces ambiguity for <code>foo(m)</code>, but is this allowed, when expression is of type <code>int</code> (or another that can be converted to <code>int</code>)?</p>
  
  <p>I have tried to find some standard reference on this, yet with no luck.</p>
  
  <hr>
  
  <p><sup><strong>Disclaimer</strong>: Note that it's not duplicate of <a href="https://stackoverflow.com/questions/5465293/function-overloading-based-on-value-vs-const-reference">Function Overloading Based on Value vs. Const Reference</a>. The <code>const</code> references are different as they can be assigned with <strong><em>rvalues</em></strong>, as opposite to "ordinary", non-<code>const</code> references.</sup></p>