r177553 - Do the error recovery for @end only.
Fariborz Jahanian
fjahanian at apple.com
Wed Mar 20 11:45:50 PDT 2013
Author: fjahanian
Date: Wed Mar 20 13:45:49 2013
New Revision: 177553
URL: http://llvm.org/viewvc/llvm-project?rev=177553&view=rev
Log:
Do the error recovery for @end only.
I am not sure how much we can improve for
when a randon ObjC keyword is thrown into the
ivar decl. block. // rdar://6854840
Modified:
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/test/Parser/missing-closing-rbrace.m
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=177553&r1=177552&r2=177553&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Wed Mar 20 13:45:49 2013
@@ -1303,10 +1303,9 @@ void Parser::ParseObjCClassInstanceVaria
visibility = Tok.getObjCKeywordID();
ConsumeToken();
continue;
- default:
- Diag(Tok, (Tok.getObjCKeywordID() == tok::objc_end) ?
- diag::err_objc_unexpected_atend :
- diag::err_objc_illegal_visibility_spec);
+
+ case tok::objc_end:
+ Diag(Tok, diag::err_objc_unexpected_atend);
Tok.setLocation(Tok.getLocation().getLocWithOffset(-1));
Tok.setKind(tok::at);
Tok.setLength(1);
@@ -1314,6 +1313,10 @@ void Parser::ParseObjCClassInstanceVaria
HelperActionsForIvarDeclarations(interfaceDecl, atLoc,
T, AllIvarDecls, true);
return;
+
+ default:
+ Diag(Tok, diag::err_objc_illegal_visibility_spec);
+ continue;
}
}
Modified: cfe/trunk/test/Parser/missing-closing-rbrace.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/missing-closing-rbrace.m?rev=177553&r1=177552&r2=177553&view=diff
==============================================================================
--- cfe/trunk/test/Parser/missing-closing-rbrace.m (original)
+++ cfe/trunk/test/Parser/missing-closing-rbrace.m Wed Mar 20 13:45:49 2013
@@ -1,12 +1,3 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// rdar: //6854840
@interface A {@end // expected-error {{'@end' appears where closing brace '}' is expected}}
-
-
- at interface B {
- at public
- int ivar;
- at protected
- id pp;
- at property (copy) id PROP; // expected-error {{illegal visibility specification}}
- at end
More information about the cfe-commits
mailing list