Visual C ++ 2012. Code. I think he should compile; the compiler respectfully disagrees. I narrowed the reproduction to:
struct B { }; void foo(B* b, signed int si) { }
So, we have two candidates for permission to overload. For the first overload, the first argument exactly matches, and for the second argument an integral conversion is required (unsigned for signing). For the second overload, the second argument matches exactly, and the first argument requires cv-tuning (because &b is a pointer to non-constant).
Now it seems that this should be absolutely unambiguous. For Overload 1, the first argument is Exact Match, as defined by the standard section for overload resolution, and the second is Conversion. For Overload 2, both arguments are โExact Coincidencesโ (qualification conversion has the same rank as personality). Therefore (my, apparently, imperfect reasoning), you should choose Overload 2 without ambiguity. But still:
a.cpp(12): error C2666: 'foo' : 2 overloads have similar conversions a.cpp(6): could be 'void foo(const B *,unsigned int)' a.cpp(5): or 'void foo(B *,int)' while trying to match the argument list '(B *, unsigned int)' note: qualification adjustment (const/volatile) may be causing the ambiguity
GCC looks great with code, both in the default dialect and in C ++ 11 (thanks, IDEOne!). Therefore, I am inclined to prevent this error in MSVC, but (a) you know that they are talking about people who think that their errors are compiler errors, and (b) it looks like this will be a fairly obvious error, sorting that would send red flags during their conformance testing.
Is it inappropriate MSVC or inappropriate GCC? (Or both?) Is my reasoning about sound overloaded?