title: How this function call is ambiguous in C++?
body: <p>Consider following program: (See live demo here <a href="http://ideone.com/7VHdoU" rel="nofollow">http://ideone.com/7VHdoU</a> )</p>
  
  <pre><code>#include &lt;iostream&gt;
  void fun(int*)=delete;
  void fun(double)=delete;
  void fun(char)=delete;
  void fun(unsigned)=delete;
  void fun(float)=delete;
  void fun(long int);
  int main()
  {
      fun(3);
  }
  void fun(long int a)
  {
      std::cout&lt;&lt;a&lt;&lt;'\n';
  }
  </code></pre>
  
  <p>Compiler is giving following error:</p>
  
  <pre><code>error: call of overloaded 'fun(int)' is ambiguous
    fun(3);
         ^
  </code></pre>
  
  <p>But I don't understand why &amp; how it is ambiguous? Does it involve any kind of automatic type promotion here? I know that calling fun with (3L) makes compilation successful.</p>