Files
clang-p2996/clang/test/Analysis/Inputs/system-header-simulator-for-nullability.h
Devin Coughlin 77942db0b8 [analyzer] Nullability: Don't warn along paths where null returned from non-null.
Change the nullability checker to not warn along paths where null is returned from
a method with a non-null return type, even when the diagnostic for this return
has been suppressed. This prevents warning from methods with non-null return types
that inline methods that themselves return nil but that suppressed the diagnostic.

Also change the PreconditionViolated state component to be called "InvariantViolated"
because it is set when a post-condition is violated, as well.

rdar://problem/25393539

llvm-svn: 264647
2016-03-28 20:30:25 +00:00

44 lines
884 B
Objective-C

#pragma clang system_header
#define nil 0
#define BOOL int
#define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
#define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
NS_ASSUME_NONNULL_BEGIN
typedef struct _NSZone NSZone;
@protocol NSObject
+ (instancetype)alloc;
- (instancetype)init;
- (instancetype)autorelease;
@end
@protocol NSCopying
- (id)copyWithZone:(nullable NSZone *)zone;
@end
@protocol NSMutableCopying
- (id)mutableCopyWithZone:(nullable NSZone *)zone;
@end
__attribute__((objc_root_class))
@interface
NSObject<NSObject>
@end
@interface NSString : NSObject<NSCopying>
- (BOOL)isEqualToString : (NSString *)aString;
- (NSString *)stringByAppendingString:(NSString *)aString;
@end
void NSSystemFunctionTakingNonnull(NSString *s);
@interface NSSystemClass : NSObject
- (void) takesNonnull:(NSString *)s;
@end
NS_ASSUME_NONNULL_END