annotate clang/test/Parser/objc-forcollection-neg-2.m @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900 (2021-07-18)
parents 1d019706d866
children c4bab56944e8
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 -Wno-objc-root-class %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 typedef struct objc_class *Class;
anatofuz
parents:
diff changeset
4 struct __objcFastEnumerationState;
anatofuz
parents:
diff changeset
5 typedef struct objc_object {
anatofuz
parents:
diff changeset
6 Class isa;
anatofuz
parents:
diff changeset
7 } *id;
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 @protocol P @end
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 @interface MyList
anatofuz
parents:
diff changeset
12 @end
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 @implementation MyList
anatofuz
parents:
diff changeset
15 - (unsigned int)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state objects: (id *)items count:(unsigned int)stackcount
anatofuz
parents:
diff changeset
16 {
anatofuz
parents:
diff changeset
17 return 0;
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19 @end
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 @interface MyList (BasicTest)
anatofuz
parents:
diff changeset
22 - (void)compilerTestAgainst;
anatofuz
parents:
diff changeset
23 @end
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 @implementation MyList (BasicTest)
anatofuz
parents:
diff changeset
26 - (void)compilerTestAgainst {
anatofuz
parents:
diff changeset
27 static i;// expected-warning {{type specifier missing, defaults to 'int'}}
anatofuz
parents:
diff changeset
28 for (id el, elem in self) // expected-error {{only one element declaration is allowed}}
anatofuz
parents:
diff changeset
29 ++i;
anatofuz
parents:
diff changeset
30 for (id el in self)
anatofuz
parents:
diff changeset
31 ++i;
anatofuz
parents:
diff changeset
32 MyList<P> ***p;
anatofuz
parents:
diff changeset
33 for (p in self) // expected-error {{selector element type 'MyList<P> ***' is not a valid object}}
anatofuz
parents:
diff changeset
34 ++i;
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 }
anatofuz
parents:
diff changeset
37 @end
anatofuz
parents:
diff changeset
38