diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-01-10 17:58:07 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-01-10 17:58:07 +0000 |
commit | 94cdb25a49bd3716ab56ef6de0ea57d29e686bf2 (patch) | |
tree | 9b40e0d76446d46b5ef2cbf7ce6a0d3402d8e0c0 /Parse/ParseObjc.cpp | |
parent | fea89c2020c02d902735f7b02658b92e102d9ae0 (diff) |
Warn (as gcc does) when @end does not close anything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45834 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Parse/ParseObjc.cpp')
-rw-r--r-- | Parse/ParseObjc.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp index 989f1dce17..34694ef5c5 100644 --- a/Parse/ParseObjc.cpp +++ b/Parse/ParseObjc.cpp @@ -991,13 +991,10 @@ Parser::DeclTy *Parser::ParseObjCAtEndDeclaration(SourceLocation atLoc) { assert(Tok.isObjCAtKeyword(tok::objc_end) && "ParseObjCAtEndDeclaration(): Expected @end"); ConsumeToken(); // the "end" identifier - if (ObjCImpDecl) { - // Checking is not necessary except that a parse error might have caused - // @implementation not to have been parsed to completion and ObjCImpDecl - // could be 0. + if (ObjCImpDecl) Actions.ActOnAtEnd(atLoc, ObjCImpDecl); - } - + else + Diag(atLoc, diag::warn_expected_implementation); // missing @implementation return ObjCImpDecl; } |