Rafael Espindola | 14f9889 | 2013-09-27 20:21:48 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class -disable-objc-default-synthesize-properties %s |
Fariborz Jahanian | 3ac1eda | 2010-01-20 01:51:55 +0000 | [diff] [blame] | 2 | |
| 3 | @protocol PROTOCOL0 |
| 4 | @required |
Fariborz Jahanian | b860739 | 2011-08-27 21:55:47 +0000 | [diff] [blame] | 5 | @property float MyProperty0; // expected-note 2 {{property declared}} |
Fariborz Jahanian | 3ac1eda | 2010-01-20 01:51:55 +0000 | [diff] [blame] | 6 | @end |
| 7 | |
| 8 | @protocol PROTOCOL<PROTOCOL0> |
| 9 | @required |
Fariborz Jahanian | b860739 | 2011-08-27 21:55:47 +0000 | [diff] [blame] | 10 | @property float MyProperty; // expected-note 2 {{property declared}} |
Fariborz Jahanian | 3ac1eda | 2010-01-20 01:51:55 +0000 | [diff] [blame] | 11 | @optional |
| 12 | @property float OptMyProperty; |
| 13 | @end |
| 14 | |
| 15 | @interface I <PROTOCOL> |
| 16 | @end |
| 17 | |
Fariborz Jahanian | b860739 | 2011-08-27 21:55:47 +0000 | [diff] [blame] | 18 | @implementation I @end // expected-warning {{property 'MyProperty0' requires method 'MyProperty0' to be defined}} \ |
| 19 | // expected-warning {{property 'MyProperty0' requires method 'setMyProperty0:' to be defined}}\ |
| 20 | // expected-warning {{property 'MyProperty' requires method 'MyProperty' to be defined}} \ |
| 21 | // expected-warning {{property 'MyProperty' requires method 'setMyProperty:' to be defined}} |
Fariborz Jahanian | a929ec7 | 2011-09-27 00:23:52 +0000 | [diff] [blame] | 22 | |
| 23 | // rdar://10120691 |
| 24 | // property is implemented in super class. No warning |
| 25 | |
| 26 | @protocol PROTOCOL1 |
| 27 | @property int MyProp; |
| 28 | @end |
| 29 | |
| 30 | @interface superclass |
| 31 | @property int MyProp; |
| 32 | @end |
| 33 | |
| 34 | @interface childclass : superclass <PROTOCOL1> |
| 35 | @end |
| 36 | |
| 37 | @implementation childclass |
| 38 | @end |
| 39 | |