const T*& and const T* do not produce ambiguity on function overload
<ul>
<li>Why the following sample code do not produce ambiguity</li>
<li>Is there any way to call the second version? (If this is not a bug)</li>
</ul>

<hr>

<pre><code>#include &lt;iostream&gt;
using namespace std;

void foo(const int*){cout &lt;&lt; "no ref";}
void foo(const int*&amp;){cout &lt;&lt; "on ref";}

int main()
{
   int* i=nullptr;
   foo(i);
}
</code></pre>

<hr>

<p>EDIT:</p>

<p>This</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

void foo(const int){cout &lt;&lt; "no ref";}
void foo(const int&amp;){cout &lt;&lt; "on ref";}

int main()
{
   int i=0;
   foo(i);
}
</code></pre>

<p>Do produce ambiguity.</p>

<hr>

<p>By the way, remove the const produce ambiguity.</p>

<p>compiler: g++5.3.0 with flag --std=c++14</p>