annotate clang/test/SemaObjC/property-missing.m @ 180:680fa57a2f20

fix compile errors.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 30 May 2020 17:44:06 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // PR3234
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 @protocol NSCopying @end
anatofuz
parents:
diff changeset
6 @interface NSObject @end
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 void f1(NSObject *o)
anatofuz
parents:
diff changeset
9 {
anatofuz
parents:
diff changeset
10 o.foo; // expected-error{{property 'foo' not found on object of type 'NSObject *'}}
anatofuz
parents:
diff changeset
11 }
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 void f2(id<NSCopying> o)
anatofuz
parents:
diff changeset
14 {
anatofuz
parents:
diff changeset
15 o.foo; // expected-error{{property 'foo' not found on object of type 'id<NSCopying>'}}
anatofuz
parents:
diff changeset
16 }
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 void f3(id o)
anatofuz
parents:
diff changeset
19 {
anatofuz
parents:
diff changeset
20 o.foo; // expected-error{{property 'foo' not found on object of type 'id'}}
anatofuz
parents:
diff changeset
21 }
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 // rdar://8851803
anatofuz
parents:
diff changeset
24 @class SomeOtherClass; // expected-note {{forward declaration of class here}}
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 @interface MyClass {
anatofuz
parents:
diff changeset
27 SomeOtherClass *someOtherObject;
anatofuz
parents:
diff changeset
28 }
anatofuz
parents:
diff changeset
29 @end
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 void foo(MyClass *myObject) {
anatofuz
parents:
diff changeset
32 myObject.someOtherObject.someProperty = 0; // expected-error {{property 'someOtherObject' refers to an incomplete Objective-C class 'SomeOtherClass' (with no @interface available)}}
anatofuz
parents:
diff changeset
33 }
anatofuz
parents:
diff changeset
34