Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Anders Carlsson | 00165a2 | 2008-12-19 17:27:57 +0000 | [diff] [blame] | 2 | |
| 3 | // PR3234 |
| 4 | |
| 5 | @protocol NSCopying @end |
| 6 | @interface NSObject @end |
| 7 | |
| 8 | void f1(NSObject *o) |
| 9 | { |
| 10 | o.foo; // expected-error{{property 'foo' not found on object of type 'NSObject *'}} |
| 11 | } |
| 12 | |
| 13 | void f2(id<NSCopying> o) |
| 14 | { |
| 15 | o.foo; // expected-error{{property 'foo' not found on object of type 'id<NSCopying>'}} |
| 16 | } |
| 17 | |
| 18 | void f3(id o) |
| 19 | { |
Steve Naroff | 14108da | 2009-07-10 23:34:53 +0000 | [diff] [blame] | 20 | o.foo; // expected-error{{property 'foo' not found on object of type 'id'}} |
Anders Carlsson | 00165a2 | 2008-12-19 17:27:57 +0000 | [diff] [blame] | 21 | } |
| 22 | |
Fariborz Jahanian | 41aadbc | 2011-02-17 01:26:14 +0000 | [diff] [blame] | 23 | // rdar://8851803 |
Douglas Gregor | b302996 | 2011-11-14 22:10:01 +0000 | [diff] [blame] | 24 | @class SomeOtherClass; // expected-note {{forward declaration of class here}} |
Fariborz Jahanian | 41aadbc | 2011-02-17 01:26:14 +0000 | [diff] [blame] | 25 | |
| 26 | @interface MyClass { |
| 27 | SomeOtherClass *someOtherObject; |
| 28 | } |
| 29 | @end |
| 30 | |
| 31 | void foo(MyClass *myObject) { |
Fariborz Jahanian | 2a96bf5 | 2011-02-17 17:30:05 +0000 | [diff] [blame] | 32 | myObject.someOtherObject.someProperty = 0; // expected-error {{property 'someOtherObject' refers to an incomplete Objective-C class 'SomeOtherClass' (with no @interface available)}} |
Fariborz Jahanian | 41aadbc | 2011-02-17 01:26:14 +0000 | [diff] [blame] | 33 | } |
| 34 | |