diff options
| author | Douglas Gregor <dgregor@apple.com> | 2015-07-07 03:58:54 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2015-07-07 03:58:54 +0000 |
| commit | 1ac1b63c9ca898e66aae9775cca6045082907b9a (patch) | |
| tree | b9196b185b0185c84e60f99881aaffd69f4da93d /clang/test/Index/comment-objc-parameterized-classes.m | |
| parent | ab209d83be5dadff4f17364a71f323b89e3c63f8 (diff) | |
| download | bcm5719-llvm-1ac1b63c9ca898e66aae9775cca6045082907b9a.tar.gz bcm5719-llvm-1ac1b63c9ca898e66aae9775cca6045082907b9a.zip | |
Implement variance for Objective-C type parameters.
Introduce co- and contra-variance for Objective-C type parameters,
which allows us to express that (for example) an NSArray is covariant
in its type parameter. This means that NSArray<NSMutableString *> * is
a subtype of NSArray<NSString *> *, which is expected of the immutable
Foundation collections.
Type parameters can be annotated with __covariant or __contravariant
to make them co- or contra-variant, respectively. This feature can be
detected by __has_feature(objc_generics_variance). Implements
rdar://problem/20217490.
llvm-svn: 241549
Diffstat (limited to 'clang/test/Index/comment-objc-parameterized-classes.m')
| -rw-r--r-- | clang/test/Index/comment-objc-parameterized-classes.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Index/comment-objc-parameterized-classes.m b/clang/test/Index/comment-objc-parameterized-classes.m index 173fcecf331..5a928509dfe 100644 --- a/clang/test/Index/comment-objc-parameterized-classes.m +++ b/clang/test/Index/comment-objc-parameterized-classes.m @@ -13,7 +13,7 @@ @interface NSObject @end -// CHECK: <Declaration>@interface A <T : id, U : NSObject *> : NSObject +// CHECK: <Declaration>@interface A <__covariant T : id, U : NSObject *> : NSObject /// A -@interface A<T : id, U : NSObject *> : NSObject +@interface A<__covariant T : id, U : NSObject *> : NSObject @end |

