This is an archive of the discontinued LLVM Phabricator instance.

[ObjC++] Conversions from specialized to non-specialized objective-c object type should be preferred over conversions to other object pointers
ClosedPublic

Authored by arphaman on Apr 3 2017, 5:28 AM.

Details

Summary

Right now Clang will select incorrect overload when the Objective-C interface type is specialized, e.g.:

void overload(Base *b);
void overload(Derived *d);
void test(Base<Base *> b) {
  overload(b); // This will select (Derived *) overload
}

This patch ensures that the conversion from specialized to non-specialized type that points to the same interface is better than the other objective-c pointer conversions.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman created this revision.Apr 3 2017, 5:28 AM
ahatanak accepted this revision.Apr 4 2017, 9:36 AM

LGTM

This revision is now accepted and ready to land.Apr 4 2017, 9:36 AM
This revision was automatically updated to reflect the committed changes.