summaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-03-20 18:45:49 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-03-20 18:45:49 +0000
commit695031cd78fe789efbb88504372413432ae2feaa (patch)
tree7d233bdb1070379d8113a4deba30537eddc96d99 /lib/Parse/ParseObjc.cpp
parentb02d1733cf0e4574d7a16152c5d9371e16a58207 (diff)
downloadclang-695031cd78fe789efbb88504372413432ae2feaa.tar.gz
clang-695031cd78fe789efbb88504372413432ae2feaa.tar.bz2
clang-695031cd78fe789efbb88504372413432ae2feaa.tar.xz
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index badbee2b5b..e4a880e89a 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -1303,10 +1303,9 @@ void Parser::ParseObjCClassInstanceVariables(Decl *interfaceDecl,
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::ParseObjCClassInstanceVariables(Decl *interfaceDecl,
HelperActionsForIvarDeclarations(interfaceDecl, atLoc,
T, AllIvarDecls, true);
return;
+
+ default:
+ Diag(Tok, diag::err_objc_illegal_visibility_spec);
+ continue;
}
}