From: Fariborz Jahanian Date: Fri, 5 Dec 2008 18:38:31 +0000 (+0000) Subject: Fixed a test case. Added a test case showing property setter's X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8ef2ecf08fbadd3901f583a559a73e4443fa882;p=clang Fixed a test case. Added a test case showing property setter's type mismatch (related to my last patch). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60599 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaObjC/method-typecheck-1.m b/test/SemaObjC/method-typecheck-1.m index 3b1b0c95a6..391f25e4d8 100644 --- a/test/SemaObjC/method-typecheck-1.m +++ b/test/SemaObjC/method-typecheck-1.m @@ -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 index 0000000000..c02cbe03b8 --- /dev/null +++ b/test/SemaObjC/property-typecheck-1.m @@ -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 +