blob: 3ebf0a81159c5bcaa72ea8e2e1ff8928ccd06288 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Anders Carlsson00165a22008-12-19 17:27:57 +00002
3// PR3234
4
5@protocol NSCopying @end
6@interface NSObject @end
7
8void f1(NSObject *o)
9{
10 o.foo; // expected-error{{property 'foo' not found on object of type 'NSObject *'}}
11}
12
13void f2(id<NSCopying> o)
14{
15 o.foo; // expected-error{{property 'foo' not found on object of type 'id<NSCopying>'}}
16}
17
18void f3(id o)
19{
Steve Naroff14108da2009-07-10 23:34:53 +000020 o.foo; // expected-error{{property 'foo' not found on object of type 'id'}}
Anders Carlsson00165a22008-12-19 17:27:57 +000021}
22
Fariborz Jahanian41aadbc2011-02-17 01:26:14 +000023// rdar://8851803
Douglas Gregorb3029962011-11-14 22:10:01 +000024@class SomeOtherClass; // expected-note {{forward declaration of class here}}
Fariborz Jahanian41aadbc2011-02-17 01:26:14 +000025
26@interface MyClass {
27 SomeOtherClass *someOtherObject;
28}
29@end
30
31void foo(MyClass *myObject) {
Fariborz Jahanian2a96bf52011-02-17 17:30:05 +000032 myObject.someOtherObject.someProperty = 0; // expected-error {{property 'someOtherObject' refers to an incomplete Objective-C class 'SomeOtherClass' (with no @interface available)}}
Fariborz Jahanian41aadbc2011-02-17 01:26:14 +000033}
34