llvm-project/clang/test/SemaObjC/property-ns-returns-not-retained-attr.m
Patrick Beard acfbe9e1f2 Added a new attribute, objc_root_class, which informs the compiler when a root class is intentionally declared.
The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger
the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698>

llvm-svn: 154187
2012-04-06 18:12:22 +00:00

22 lines
739 B
Objective-C

// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -verify -Wno-objc-root-class %s
// rdar://9636091
@interface I
@property (nonatomic, retain) id newName __attribute__((ns_returns_not_retained)) ;
@property (nonatomic, retain) id newName1 __attribute__((ns_returns_not_retained)) ;
- (id) newName1 __attribute__((ns_returns_not_retained));
@property (nonatomic, retain) id newName2 __attribute__((ns_returns_not_retained)); // expected-note {{roperty declared here}}
- (id) newName2; // expected-warning {{property declared as returning non-retained objects; getter returning retained objects}}
@end
@implementation I
@synthesize newName;
@synthesize newName1;
- (id) newName1 { return 0; }
@synthesize newName2;
@end