title: Why is this function call ambiguous?
body: <p>I'm reading the standard and trying to figure out why this code won't be resolved without a cast. </p>
  
  <pre><code>void foo(char c) { }
  
  // Way bigger than char
  void foo(unsigned long int) { }
  
  int main()
  {
     foo(123456789); // ambiguous
     foo((unsigned long int) 123456789); // works
  }
  </code></pre>
  
  <p>Here's what it says:</p>
  
  <blockquote>
    <p>4.13 Integer conversion rank [conv.rank]</p>
    
    <p>Every integer type has an integer conversion rank defined
    as follows: </p>
    
    <p>— The rank of any unsigned integer type shall equal the rank of the
    corresponding signed integer type. </p>
    
    <p>— The rank of char shall equal the rank of signed char and unsigned
    char.</p>
  </blockquote>
  
  <p>In particular, what rustles my jimmies is that it doesn't say ANY unsigned integral type, just unsigned char. My guess is that char is being promoted to an unsigned type via conversion. Is this true?</p>