]> granicus.if.org Git - clang/commitdiff
Fixed a test case. Added a test case showing property setter's
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 5 Dec 2008 18:38:31 +0000 (18:38 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 5 Dec 2008 18:38:31 +0000 (18:38 +0000)
type mismatch (related to my last patch).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60599 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaObjC/method-typecheck-1.m
test/SemaObjC/property-typecheck-1.m [new file with mode: 0644]

index 3b1b0c95a6f2fba29d4097ac7df9ccdc0ba92b5a..391f25e4d840225a196b0ff6ab4788ccc2016429 100644 (file)
@@ -1,3 +1,5 @@
+// RUN: clang -fsyntax-only -verify %s
+
 @interface A
 - (void) setMoo: (int) x;      //  expected-note {{previous definition is here}}
 - (int) setMoo1: (int) x;      //  expected-note {{previous definition is here}}
diff --git a/test/SemaObjC/property-typecheck-1.m b/test/SemaObjC/property-typecheck-1.m
new file mode 100644 (file)
index 0000000..c02cbe0
--- /dev/null
@@ -0,0 +1,19 @@
+// RUN: clang -fsyntax-only -verify %s
+
+@interface A
+-(float) x;
+@property int x; // expected-error {{type of property 'x' does not match type of accessor 'x'}}
+@end
+
+@interface A (Cat)
+@property int moo;     // expected-note {{previous definition is here}}
+@end
+
+@implementation A (Cat)
+-(int) moo {
+  return 0;
+}
+-(void) setMoo: (float) x { // expected-warning {{conflicting types for 'setMoo:'}}
+}
+@end
+