diff options
| author | Anna Zaks <ganna@apple.com> | 2013-01-17 23:24:58 +0000 |
|---|---|---|
| committer | Anna Zaks <ganna@apple.com> | 2013-01-17 23:24:58 +0000 |
| commit | 0e9c94199cbb814f3f8b88eef951e8880c0da9cc (patch) | |
| tree | 81c0e8706e8d131dc8ef12c79d34649c34b5d470 /clang/test/Analysis/objc | |
| parent | d33f5201b5f413d0985338a6e5baf403b0e8167b (diff) | |
| download | bcm5719-llvm-0e9c94199cbb814f3f8b88eef951e8880c0da9cc.tar.gz bcm5719-llvm-0e9c94199cbb814f3f8b88eef951e8880c0da9cc.zip | |
[analyzer] DirectIvarAssignment: allow suppression annotation on Ivars.
llvm-svn: 172766
Diffstat (limited to 'clang/test/Analysis/objc')
| -rw-r--r-- | clang/test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m b/clang/test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m index 300f9775bfb..f4497865699 100644 --- a/clang/test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m +++ b/clang/test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m @@ -23,6 +23,7 @@ typedef signed char BOOL; @interface TestProperty : AnnotatedClass { MyClass *_Z; id _nonSynth; + MyClass* _NotA __attribute__((annotate("objc_allow_direct_instance_variable_assignment"))); } @property (assign, nonatomic) MyClass* A; // explicitely synthesized, not implemented, non-default ivar name @@ -33,7 +34,8 @@ typedef signed char BOOL; @property (assign, nonatomic) MyClass* Z; // non synthesized ivar, implemented setter @property (readonly) id nonSynth; // non synthesized, explicitly implemented to return ivar with expected name - + + @property (assign) MyClass* NotA; // warnings should be suppressed, backing ivar is annotated @property (assign) MyClass* NotX __attribute__((annotate("objc_allow_direct_instance_variable_assignment"))); // warnings should be suppressed @end @@ -48,6 +50,7 @@ typedef signed char BOOL; _Z = In; // expected-warning {{Direct assignment to an instance variable backing a property; use the setter instead}} _nonSynth = 0; // expected-warning {{Direct assignment to an instance variable backing a property; use the setter instead}} _NotX = 0; // no-warning + _NotA = 0; // no-warning } - (void) someMethodNotAnnaotated: (MyClass*)In { (__A) = In; |

