diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-18 19:45:45 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-18 19:45:45 +0000 |
commit | 88e72a0bf662f086d56a4919cdb324ca828fea7c (patch) | |
tree | 881bbd6e177bc4b1f6c604e213a6d6d90d47c585 /clang/lib | |
parent | ac11b7b625df5626d9a6900203f3011b1974b2c1 (diff) | |
download | bcm5719-llvm-88e72a0bf662f086d56a4919cdb324ca828fea7c.tar.gz bcm5719-llvm-88e72a0bf662f086d56a4919cdb324ca828fea7c.zip |
Improve diagnostics and recovery when parsing @synthesized definitions
llvm-svn: 89227
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Parse/ParseObjc.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index e1f045bd8e2..8d6fd209c61 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -1236,7 +1236,13 @@ Parser::DeclPtrTy Parser::ParseObjCPropertySynthesize(SourceLocation atLoc) { return DeclPtrTy(); } - while (Tok.is(tok::identifier)) { + while (true) { + if (Tok.isNot(tok::identifier)) { + Diag(Tok, diag::err_synthesized_property_name); + SkipUntil(tok::semi); + return DeclPtrTy(); + } + IdentifierInfo *propertyIvar = 0; IdentifierInfo *propertyId = Tok.getIdentifierInfo(); SourceLocation propertyLoc = ConsumeToken(); // consume property name @@ -1256,8 +1262,10 @@ Parser::DeclPtrTy Parser::ParseObjCPropertySynthesize(SourceLocation atLoc) { break; ConsumeToken(); // consume ',' } - if (Tok.isNot(tok::semi)) + if (Tok.isNot(tok::semi)) { Diag(Tok, diag::err_expected_semi_after) << "@synthesize"; + SkipUntil(tok::semi); + } else ConsumeToken(); // consume ';' return DeclPtrTy(); |