blob: 3850f217beea822f136557949075d21cc01e0026 [file] [log] [blame]
Daniel Dunbar02022f42009-04-10 21:23:20 +00001// RUN: clang-cc -triple i386-apple-darwin9 -fsyntax-only -fobjc-gc -verify %s
Fariborz Jahanian80b0b422008-11-20 18:10:58 +00002
3struct S {
4 __weak id w; // expected-warning {{__weak attribute cannot be specified on a field declaration}}
5 __strong id p1;
6};
7
Fariborz Jahanian24b93f22008-11-20 19:35:51 +00008@interface I
9{
10 __weak id w; // OK
11 __strong id LHS;
12}
13- (void) foo;
14@end
15@implementation I
16- (void) foo { w = 0; LHS = w; }
17@end
18
Fariborz Jahanian80b0b422008-11-20 18:10:58 +000019int main ()
20{
21 struct I {
22 __weak id w1; // expected-warning {{__weak attribute cannot be specified on a field declaration}}
23 };
24}