diff options
| author | Douglas Gregor <dgregor@apple.com> | 2015-06-19 18:14:38 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2015-06-19 18:14:38 +0000 |
| commit | 813a066f16df52783708fdc2ef708bb76a9ff521 (patch) | |
| tree | 0657ccae705e2a09c50dd92d26d645bff370aded /clang/test/SemaObjC/override-nullability.m | |
| parent | b4866e85e5ffa0d352d496958582f0983172dc01 (diff) | |
| download | bcm5719-llvm-813a066f16df52783708fdc2ef708bb76a9ff521.tar.gz bcm5719-llvm-813a066f16df52783708fdc2ef708bb76a9ff521.zip | |
Extend type nullability qualifiers for Objective-C.
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
Diffstat (limited to 'clang/test/SemaObjC/override-nullability.m')
| -rw-r--r-- | clang/test/SemaObjC/override-nullability.m | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/override-nullability.m b/clang/test/SemaObjC/override-nullability.m new file mode 100644 index 00000000000..8e29f915275 --- /dev/null +++ b/clang/test/SemaObjC/override-nullability.m @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -Wnonnull %s -verify +//rdar://19211059 + +@interface NSObject @end + +@interface Base : NSObject +- (nonnull id)bad:(nullable id)obj; // expected-note 2 {{previous declaration is here}} +- (nullable id)notAsBad:(nonnull id)obj; +@end + +@interface Sub : Base +- (nullable id)bad:(nonnull id)obj; // expected-warning {{conflicting nullability specifier on return types, 'nullable' conflicts with existing specifier 'nonnull'}} \ + // expected-warning {{conflicting nullability specifier on parameter types, 'nonnull' conflicts with existing specifier 'nullable'}} +- (nonnull id)notAsBad:(nullable id)obj; +@end |

