2013-04-25 07:23:47 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -Wno-objc-root-class -verify %s
|
|
|
|
// rdar://12233858
|
|
|
|
|
|
|
|
@protocol P
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface I @end
|
|
|
|
|
2014-03-08 06:36:23 +08:00
|
|
|
@implementation I<P> @end // expected-error {{@implementation declaration cannot be protocol qualified}}
|
2013-04-25 07:23:47 +08:00
|
|
|
|
|
|
|
@interface J < P,P >
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
2014-03-08 06:36:23 +08:00
|
|
|
@implementation J < P,P > // expected-error {{@implementation declaration cannot be protocol qualified}}
|
2013-04-25 07:23:47 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface K @end
|
|
|
|
|
Parsing, semantic analysis, and AST for Objective-C type parameters.
Produce type parameter declarations for Objective-C type parameters,
and attach lists of type parameters to Objective-C classes,
categories, forward declarations, and extensions as
appropriate. Perform semantic analysis of type bounds for type
parameters, both in isolation and across classes/categories/extensions
to ensure consistency.
Also handle (de-)serialization of Objective-C type parameter lists,
along with sundry other things one must do to add a new declaration to
Clang.
Note that Objective-C type parameters are typedef name declarations,
like typedefs and C++11 type aliases, in support of type erasure.
Part of rdar://problem/6294649.
llvm-svn: 241541
2015-07-07 11:57:15 +08:00
|
|
|
@implementation K <P // expected-error {{@implementation declaration cannot be protocol qualified}} expected-note{{to match this '<'}}
|
2013-04-25 07:23:47 +08:00
|
|
|
@end // expected-error {{expected '>'}}
|
2013-05-18 01:58:11 +08:00
|
|
|
|
|
|
|
// rdar://13920026
|
2014-03-08 06:36:23 +08:00
|
|
|
@implementation I (Cat) <P> // expected-error {{@implementation declaration cannot be protocol qualified}}
|
2013-05-18 01:58:11 +08:00
|
|
|
- (void) Meth {}
|
|
|
|
@end
|
|
|
|
|
2014-03-08 06:36:23 +08:00
|
|
|
@implementation I (Cat1) <P // expected-error {{@implementation declaration cannot be protocol qualified}}
|
2013-05-18 01:58:11 +08:00
|
|
|
@end // expected-error {{expected '>'}}
|