title: Why an implicit-conversion-sequence is not the best ICS if it's using a "Promotion"?
body: <p>Compiling this piece of code:</p>
  
  <pre><code>int func( int ) {
   return 1;
  }
  int func( char ) {
   return 2;
  }
  struct foo {
    operator int() { // Call to 'func(a)' is ambigous #1
    // operator char() { // Call to 'func(a)' is not ambigous #2
    return 1;
   }
   operator float() {
    return 0.f;
   }
  };
  
  int test_it (void) {
   foo a;
   return (func(a)==2);
  }
  </code></pre>
  
  <p>if I define, for <code>foo</code>  the <code>int</code>-conversion operator instead of char, many compiler find the call <code>func(a)</code> ambiguous, only 1 compiler find it not ambiguous.</p>
  
  <p><a href="https://godbolt.org/g/zhRJZB" rel="nofollow noreferrer">https://godbolt.org/g/zhRJZB</a></p>
  
  <p>Reading the standard, I am not expecting that, because:</p>
  
  <p>if I compile <code>#2</code> the struct <code>a</code> is converted from <code>foo -&gt; char</code> and then <code>char -&gt; char</code> this is the best implicit conversion sequence (ICS) of the candidate set made by:</p>
  
  <pre><code>(1) foo -&gt;  char : char -&gt; char
  (2) foo -&gt;  char : char -&gt; int 
  (3) foo -&gt;  float : float -&gt; int
  (3) foo -&gt;  float : float -&gt; char
  </code></pre>
  
  <p>the conversion <code>char -&gt; int</code> is a promotion so the rank of this conversion (2) is "Promotion" and it is worst than "Exact match" (1) , 
  <code>float -&gt; int</code> is a (3) "Conversion" </p>
  
  <p>In case <code>#1</code> instead:</p>
  
  <pre><code> foo -&gt;  int : int -&gt; int
  </code></pre>
  
  <p>should be the best ICS, because :</p>
  
  <pre><code>(1) foo -&gt;  int : int -&gt; int better than 
  (3) foo -&gt;  int : int -&gt; char 
  (3) foo -&gt;  float : float -&gt; int
  (3) foo -&gt;  float : float -&gt; char
  </code></pre>
  
  <p>So in this candidate set, should be only implicit conversion sequence that is better than the other.</p>
  
  <p>Can somebody explain me why the code should be ambiguous?</p>