I'm reading Stroustrup's book, the section on overloading and related ambiguities.
There's an example as follows:
void f1(char);
void f1(long);
void k(int i)
{
f1(i); //ambiguous: f1(char) or f1(long)
}
As the comment states, the call is ambiguous. Why?
The previous section in the book stated 5 rules based on matching formal and actual parameters. So shouldn't the above function call come under rule 2, regarding "promotions"? My guess was that 'i' should be promoted to a long, and that's that.
As per the comment, it seems that a int to char conversion (a demotion?) also comes under rule 2?