Add implicit conversions for Objective-C qualified ids, e.g.,
id<P0>
The intended overloading behavior of these entities isn't entirely
clear, and GCC seems to have some strange limitations (e.g., the
inability to overload on id<P0> vs. id<P1>). We'll want to revisit
these semantics and determine just how Objective-C++ overloading
should really work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60142 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjCXX/overload.mm b/test/SemaObjCXX/overload.mm
index f4477d3..8a42746 100644
--- a/test/SemaObjCXX/overload.mm
+++ b/test/SemaObjCXX/overload.mm
@@ -1,10 +1,19 @@
// RUN clang -fsyntax-only -verify %s
-@interface A
+@protocol P0
+@end
+
+@protocol P1
+@end
+
+@interface A <P0>
@end
@interface B : A
@end
+@interface C <P1>
+@end
+
int& f(A*);
float& f(B*);
void g(A*);
@@ -37,3 +46,13 @@
int& i3 = cv2(a);
float& f3 = cv2(ac);
}
+
+
+int& qualid(id<P0>);
+float& qualid(id<P1>); // FIXME: GCC complains that this isn't an overload. Is it?
+
+void qualid_test(A *a, B *b, C *c) {
+ int& i1 = qualid(a);
+ int& i2 = qualid(b);
+ float& f1 = qualid(c);
+}