When comparing Objective-C pointers during overload resolution to
determine which is a better conversion to "void*", be sure to perform
the comparison using the safe-for-id
ASTContext::canAssignObjCInterfaces() rather than the asserts-with-id
ASTContext::canAssignObjCInterfaces().
Fixes <rdar://problem/9327203>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130259 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjCXX/overload.mm b/test/SemaObjCXX/overload.mm
index 09cd3ec..960a7b2 100644
--- a/test/SemaObjCXX/overload.mm
+++ b/test/SemaObjCXX/overload.mm
@@ -159,3 +159,15 @@
int &ir2 = f3(bc);
}
}
+
+@interface D : B
+@end
+
+namespace rdar9327203 {
+ int &f(void* const&, int);
+ float &f(void* const&, long);
+
+ void g(id x) {
+ int &fr = (f)(x, 0);
+ }
+}