﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
82	Wrong Overload Chosen	Rob Schluntz	a3moss	"The following example currently chooses the signed ?-?, but should choose unsigned ?-?. I believe it’s getting there because it delays the conversion cost for arguments until getting to bsearch, so by this point signed ?-? and unsigned ?-? are still both candidates, and unsigned ?-? fails because E is bound to unsigned and signed */unsigned * do not unify. 
{{{
forall( E ) void bsearch( E key, const E * vals );
signed int ?-?( signed int, signed int );
unsigned int ?-?( unsigned int, unsigned int );

void f() {
  int iarr[10];
  bsearch( (unsigned int)10 - (unsigned int)0, iarr );
}
}}}

If you take the polymorphism away, the unsigned ?-? is chosen.
{{{
void bsearch( signed int key, const signed int * vals );  // chosen
void bsearch( unsigned key, const unsigned int * vals );
signed int ?-?( signed int, signed int );
unsigned int ?-?( unsigned int, unsigned int );           // chosen

void f() {
  int iarr[10];
  bsearch( (unsigned int)10 - (unsigned int)0, iarr );
} 
}}}"	defect	assigned	minor	cfa-cc	1.0		resolver overload polymorphism	
