summaryrefslogtreecommitdiff
path: root/clang/test/SemaObjC/selector-error.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaObjC/selector-error.m')
-rw-r--r--clang/test/SemaObjC/selector-error.m20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/selector-error.m b/clang/test/SemaObjC/selector-error.m
new file mode 100644
index 0000000..f59dec8
--- /dev/null
+++ b/clang/test/SemaObjC/selector-error.m
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+
+@interface Foo
+- (char*) foo;
+- (void) bar;
+@end
+
+@implementation Foo
+- (void) bar
+{
+}
+
+- (char*) foo
+{
+ char* a,b,c;
+ a = (char*)@selector(bar); // expected-error {{cannot type cast @selector expression}}
+ return (char*)@selector(bar); // expected-error {{cannot type cast @selector expression}}
+}
+@end
+