2012-08-17 04:16:46 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value %s
|
2012-08-17 02:33:47 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wcast-of-sel-type -Wno-unused-value %s
|
|
|
|
// rdar://12107381
|
|
|
|
|
|
|
|
SEL s;
|
|
|
|
|
|
|
|
SEL sel_registerName(const char *);
|
|
|
|
|
2022-02-08 04:28:35 +08:00
|
|
|
int main(void) {
|
2012-08-17 02:33:47 +08:00
|
|
|
(char *)s; // expected-warning {{cast of type 'SEL' to 'char *' is deprecated; use sel_getName instead}}
|
|
|
|
(void *)s; // ok
|
|
|
|
(const char *)sel_registerName("foo"); // expected-warning {{cast of type 'SEL' to 'const char *' is deprecated; use sel_getName instead}}
|
|
|
|
|
|
|
|
(const void *)sel_registerName("foo"); // ok
|
|
|
|
|
|
|
|
(void) s; // ok
|
|
|
|
|
|
|
|
(void *const)s; // ok
|
|
|
|
|
|
|
|
(const void *const)s; // ok
|
2012-12-13 08:42:06 +08:00
|
|
|
|
|
|
|
// rdar://12859590
|
|
|
|
(SEL)sel_registerName("foo"); // ok
|
2012-08-17 02:33:47 +08:00
|
|
|
}
|