forked from OSchip/llvm-project
Objective-C parsing. Error recovery when category implementation
declaration is illegally protocol qualified. // rdar://13920026 llvm-svn: 182136
This commit is contained in:
parent
cb63bafefc
commit
858885578d
|
@ -1541,6 +1541,12 @@ Parser::ParseObjCAtImplementationDeclaration(SourceLocation AtLoc) {
|
|||
return DeclGroupPtrTy();
|
||||
}
|
||||
rparenLoc = ConsumeParen();
|
||||
if (Tok.is(tok::less)) { // we have illegal '<' try to recover
|
||||
Diag(Tok, diag::err_unexpected_protocol_qualifier);
|
||||
AttributeFactory attr;
|
||||
DeclSpec DS(attr);
|
||||
(void)ParseObjCProtocolQualifiers(DS);
|
||||
}
|
||||
ObjCImpDecl = Actions.ActOnStartCategoryImplementation(
|
||||
AtLoc, nameId, nameLoc, categoryId,
|
||||
categoryLoc);
|
||||
|
|
|
@ -19,3 +19,11 @@
|
|||
|
||||
@implementation K <P // expected-error {{@implementation declaration can not be protocol qualified}}
|
||||
@end // expected-error {{expected '>'}}
|
||||
|
||||
// rdar://13920026
|
||||
@implementation I (Cat) <P> // expected-error {{@implementation declaration can not be protocol qualified}}
|
||||
- (void) Meth {}
|
||||
@end
|
||||
|
||||
@implementation I (Cat1) <P // expected-error {{@implementation declaration can not be protocol qualified}}
|
||||
@end // expected-error {{expected '>'}}
|
||||
|
|
Loading…
Reference in New Issue