diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-11-16 18:57:01 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-11-16 18:57:01 +0000 |
commit | 63e963cdffca9530f920dbab58b9b4eecb2a582c (patch) | |
tree | 807e73d8edf9a9d5ee0933cb78ecce26fbf98878 /include/clang | |
parent | 2a70e94c543338059432fc38b801a56c60f0e0d7 (diff) |
Handle case of missing '@end' in implementation context
gracefully, on par with gcc, by: Issuing a warning,
doing final sematinc check of its definitions and generating
its meta-data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 1 | ||||
-rw-r--r-- | include/clang/Parse/Parser.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index e3f2383798..bd0dec6a8d 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -251,6 +251,7 @@ def warn_accessor_property_type_mismatch : Warning< def note_declared_at : Note<"declared at">; def err_setter_type_void : Error<"type of setter must be void">; def err_duplicate_method_decl : Error<"duplicate declaration of method %0">; +def warn_missing_atend : Warning<"'@end' is missing in implementation context">; def err_objc_var_decl_inclass : Error<"cannot declare variable inside @interface or @protocol">; def error_missing_method_context : Error< diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 3e75189aea..f436a75e29 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -179,6 +179,8 @@ public: /// the EOF was encountered. bool ParseTopLevelDecl(DeclGroupPtrTy &Result); + DeclGroupPtrTy RetreivePendingObjCImpDecl(); + private: //===--------------------------------------------------------------------===// // Low-Level token peeking and consumption methods. @@ -783,6 +785,7 @@ private: AttributeList *prefixAttrs = 0); DeclPtrTy ObjCImpDecl; + llvm::SmallVector<DeclPtrTy, 4> PendingObjCImpDecl; DeclPtrTy ParseObjCAtImplementationDeclaration(SourceLocation atLoc); DeclPtrTy ParseObjCAtEndDeclaration(SourceLocation atLoc); |