mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 05:36:06 +00:00

Introduce context-sensitive, non-underscored nullability specifiers (nonnull, nullable, null_unspecified) for Objective-C method return types, method parameter types, and properties. Introduce Objective-C-specific semantics, including computation of the nullability of the result of a message send, merging of nullability information from the @interface of a class into its @implementation, etc . This is the Objective-C part of rdar://problem/18868820. llvm-svn: 240154
19 lines
465 B
Objective-C
19 lines
465 B
Objective-C
// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -Wnullable-to-nonnull-conversion %s -verify
|
|
|
|
|
|
// rdar://19985330
|
|
@interface NSObject @end
|
|
|
|
@class NSFoo;
|
|
void foo (NSFoo * __nonnull);
|
|
|
|
@interface NSBar : NSObject
|
|
@property(weak) NSFoo *property1;
|
|
@end
|
|
|
|
@implementation NSBar
|
|
- (void) Meth {
|
|
foo (self.property1); // expected-warning {{implicit conversion from nullable pointer 'NSFoo * __nullable' to non-nullable pointer type 'NSFoo * __nonnull'}}
|
|
}
|
|
@end
|