blob: 829acb2e199b1d21cb3a942ed2249b6122b58ead [file] [log] [blame]
// RUN: clang-cc -fsyntax-only -verify %s
// Obj-C string literal expressions
template <typename T> struct StringTest {
void f() {
(void)@"Hello";
}
};
template struct StringTest<int>;
template struct StringTest<double>;
// @selector expressions
template <typename T> struct SelectorTest {
SEL f() {
return @selector(multiple:arguments:);
}
SEL f2() {
return @selector(multiple:arguments:);
}
};
template struct SelectorTest<int>;
template struct SelectorTest<double>;
// @protocol expressions
@protocol P
@end
template <typename T> struct ProtocolTest {
void f() {
(void)@protocol(P);
}
};
template struct ProtocolTest<int>;
template struct ProtocolTest<double>;
// @encode expressions
template <typename T> struct EncodeTest {
static const char *encode(T t) {
return @encode(T);
}
};
template struct EncodeTest<int>;
template struct EncodeTest<double>;