The following is legal in C, and illegal in C++:
void *getPtr();
void foo(char *c);
int main() {
foo(getPtr());
}Currently, we only allow C++ conversions in functions with __attribute__((overloadable)) on them, even in C. So, if foo from the above example had this attribute (and overload(s)), the example would fail to compile as C. This patch teaches our overload logic that C conversions are legal if we’re overloading something in C.
As a neat side effect, this patch also potentially saves us a few bytes of heap each time we call Sema::CheckAssignmentConstraints(SourceLocation, QualType, QualType), due to additions that mention FixRHS.
Fold these two 'if's together.