teak-llvm/clang/test/Parser/objc-error-qualified-implementation.m
Douglas Gregor 85f3f9513d 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 03:57:15 +00:00

30 lines
859 B
Objective-C

// RUN: %clang_cc1 -fsyntax-only -Wno-objc-root-class -verify %s
// rdar://12233858
@protocol P
@end
@interface I @end
@implementation I<P> @end // expected-error {{@implementation declaration cannot be protocol qualified}}
@interface J < P,P >
@end
@implementation J < P,P > // expected-error {{@implementation declaration cannot be protocol qualified}}
@end
@interface K @end
@implementation K <P // expected-error {{@implementation declaration cannot be protocol qualified}} expected-note{{to match this '<'}}
@end // expected-error {{expected '>'}}
// rdar://13920026
@implementation I (Cat) <P> // expected-error {{@implementation declaration cannot be protocol qualified}}
- (void) Meth {}
@end
@implementation I (Cat1) <P // expected-error {{@implementation declaration cannot be protocol qualified}}
@end // expected-error {{expected '>'}}