// Test template instantiation of Objective-C message sends.
@interface ClassMethods
+ (ClassMethods *)method1:(void*)ptr;
@end
template<typename T>
struct identity {
typedef T type;
};
template<typename R, typename T, typename Arg1>
void test_class_method(Arg1 arg1) {
R *result1 = [T method1:arg1];
R *result2 = [typename identity<T>::type method1:arg1];
R *result3 = [ClassMethods method1:arg1]; // expected-error{{cannot initialize a variable of type 'ClassMethods2 *' with an rvalue of type 'ClassMethods *'}}
R *result2 = [im method1:arg1]; // expected-error{{cannot initialize a variable of type 'InstanceMethods2 *' with an rvalue of type 'InstanceMethods *'}}