aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-26 21:04:54 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-26 21:04:54 +0000
commit9cbfdd212ee0167f2487363d6fac7faaf7c65b64 (patch)
treeb88c8538bbc88139d878643d0625f7cd62e87984 /test
parente330354c6bfbb0d7856432fa9055d5236f1b2fa4 (diff)
Implement template instantiation for implicit property references in
Objective-C++. This is the last bit of (non-blocks-related) template instantiation logic for Objective-C++. Yay! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaObjCXX/instantiate-expr.mm22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/SemaObjCXX/instantiate-expr.mm b/test/SemaObjCXX/instantiate-expr.mm
index c480ecfa88..08be5f7b91 100644
--- a/test/SemaObjCXX/instantiate-expr.mm
+++ b/test/SemaObjCXX/instantiate-expr.mm
@@ -49,3 +49,25 @@ void f3(U ptr) {
template void f3<Class>(id);
template void f3<int>(id); // expected-note{{instantiation of}}
+
+// Implicit setter/getter
+@interface B
+- (int)foo;
+- (void)setFoo:(int)value;
+@end
+
+template<typename T>
+void f4(B *b, T value) {
+ b.foo = value; // expected-error{{assigning to 'int' from incompatible type 'int *'}}
+}
+
+template void f4(B*, int);
+template void f4(B*, int*); // expected-note{{in instantiation of function template specialization 'f4<int *>' requested here}}
+
+template<typename T, typename U>
+void f5(T ptr, U value) {
+ ptr.foo = value; // expected-error{{assigning to 'int' from incompatible type 'int *'}}
+}
+
+template void f5(B*, int);
+template void f5(B*, int*); // expected-note{{in instantiation of function template specialization 'f5<B *, int *>' requested here}}