From e9d95f1ecc98ced831cace8b4b78cb7cc380f4aa Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 7 Jul 2015 03:57:35 +0000 Subject: Handle Objective-C type arguments. Objective-C type arguments can be provided in angle brackets following an Objective-C interface type. Syntactically, this is the same position as one would provide protocol qualifiers (e.g., id), so parse both together and let Sema sort out the ambiguous cases. This applies both when parsing types and when parsing the superclass of an Objective-C class, which can now be a specialized type (e.g., NSMutableArray inherits from NSArray). Check Objective-C type arguments against the type parameters of the corresponding class. Verify the length of the type argument list and that each type argument satisfies the corresponding bound. Specializations of parameterized Objective-C classes are represented in the type system as distinct types. Both specialized types (e.g., NSArray *) and unspecialized types (NSArray *) are represented, separately. llvm-svn: 241542 --- clang/test/PCH/objc_parameterized_classes.m | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/test/PCH/objc_parameterized_classes.m') diff --git a/clang/test/PCH/objc_parameterized_classes.m b/clang/test/PCH/objc_parameterized_classes.m index a541c33fbf2..f4fd0926be3 100644 --- a/clang/test/PCH/objc_parameterized_classes.m +++ b/clang/test/PCH/objc_parameterized_classes.m @@ -19,6 +19,8 @@ __attribute__((objc_root_class)) @interface PC1 (Cat1) @end +typedef PC1 PC1Specialization1; + #else @interface PC1 PC1Specialization2; // expected-error{{type arguments cannot be applied to already-specialized class type 'PC1Specialization1' (aka 'PC1')}} + #endif -- cgit v1.2.3