• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
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{
20  o.foo; // expected-error{{property 'foo' not found on object of type 'id'}}
21}
22
23// rdar://8851803
24@class SomeOtherClass; // expected-note {{forward declaration of class here}}
25
26@interface MyClass {
27    SomeOtherClass *someOtherObject;
28}
29@end
30
31void foo(MyClass *myObject) {
32	myObject.someOtherObject.someProperty = 0; // expected-error {{property 'someOtherObject' refers to an incomplete Objective-C class 'SomeOtherClass' (with no @interface available)}}
33}
34
35