26 lines · plain
1// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -fobjc-gc -verify -Wno-objc-root-class %s2// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fsyntax-only -fobjc-gc -verify -Wno-objc-root-class %s3 4struct S {5 __weak id w; // expected-warning {{__weak attribute cannot be specified on a field declaration}}6 __strong id p1;7};8 9@interface I10{11 __weak id w; // OK12 __strong id LHS;13}14- (void) foo;15@end16@implementation I17- (void) foo { w = 0; LHS = w; }18@end19 20int main (void)21{22 struct I {23 __weak id w1; // expected-warning {{__weak attribute cannot be specified on a field declaration}}24 };25}26