xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/objc2-warn-weak-decl.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -fobjc-gc -verify %s
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fsyntax-only -fobjc-gc -verify %s
3*f4a2713aSLionel Sambucstruct S {
4*f4a2713aSLionel Sambuc	__weak id  p;  // expected-warning {{__weak attribute cannot be specified on a field declaration}}
5*f4a2713aSLionel Sambuc};
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambucint main ()
8*f4a2713aSLionel Sambuc{
9*f4a2713aSLionel Sambuc  __weak id  local;  // expected-warning {{Objective-C GC does not allow weak variables on the stack}}
10*f4a2713aSLionel Sambuc}
11*f4a2713aSLionel Sambuc
12