23 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value %s2// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wcast-of-sel-type -Wno-unused-value %s3 4SEL s;5 6SEL sel_registerName(const char *);7 8int main(void) {9(char *)s; // expected-warning {{cast of type 'SEL' to 'char *' is deprecated; use sel_getName instead}}10(void *)s; // ok11(const char *)sel_registerName("foo"); // expected-warning {{cast of type 'SEL' to 'const char *' is deprecated; use sel_getName instead}}12 13(const void *)sel_registerName("foo"); // ok14 15(void) s; // ok16 17(void *const)s; // ok18 19(const void *const)s; // ok20 21(SEL)sel_registerName("foo"); // ok22}23