diff options
Diffstat (limited to 'test/SemaObjC/objc2-warn-weak-decl.m')
-rw-r--r-- | test/SemaObjC/objc2-warn-weak-decl.m | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaObjC/objc2-warn-weak-decl.m b/test/SemaObjC/objc2-warn-weak-decl.m new file mode 100644 index 0000000..5de52ba --- /dev/null +++ b/test/SemaObjC/objc2-warn-weak-decl.m @@ -0,0 +1,10 @@ +// RUN: clang-cc -triple i386-apple-darwin9 -fsyntax-only -fobjc-gc -verify %s +struct S { + __weak id p; // expected-warning {{__weak attribute cannot be specified on a field declaration}} +}; + +int main () +{ + __weak id local; // expected-warning {{__weak attribute cannot be specified on an automatic variable}} +} + |