1 // RUN: %clang_cc1 -emit-pch %s -o %t
2 // RUN: %clang_cc1 -include-pch %t -verify %s
4 #ifndef HEADER_INCLUDED
6 #define HEADER_INCLUDED
11 __attribute__((objc_root_class))
15 @interface PC1<__covariant T, U : NSObject *> : NSObject
16 // expected-note@-2{{type parameter 'U' declared here}}
19 @interface PC1<__covariant T, U : NSObject *> (Cat1)
22 typedef PC1<id, NSObject *> PC1Specialization1;
24 typedef PC1Specialization1 <NSObject> PC1Specialization2;
27 @interface PC1<T : NSObject *, // expected-error{{type bound 'NSObject *' for type parameter 'T' conflicts with implicit bound 'id}}
28 // expected-note@15{{type parameter 'T' declared here}}
29 U : id> (Cat2) // expected-error{{type bound 'id' for type parameter 'U' conflicts with previous bound 'NSObject *'}}
30 // expected-note@15{{type parameter 'U' declared here}}
33 typedef PC1Specialization1<id, NSObject *> PC1Specialization3; // expected-error{{type arguments cannot be applied to already-specialized class type 'PC1Specialization1' (aka 'PC1<id,NSObject *>')}}
35 typedef PC1Specialization2<id, NSObject *> PC1Specialization4; // expected-error{{already-specialized class type 'PC1Specialization2' (aka 'PC1Specialization1<NSObject>')}}
37 @interface NSString : NSObject
40 void testCovariance(PC1<NSObject *, NSObject *> *pc1a,
41 PC1<NSString *, NSObject *> *pc1b) {