aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-11-16 18:57:01 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-11-16 18:57:01 +0000
commit63e963cdffca9530f920dbab58b9b4eecb2a582c (patch)
tree807e73d8edf9a9d5ee0933cb78ecce26fbf98878 /lib/Sema/SemaDeclObjC.cpp
parent2a70e94c543338059432fc38b801a56c60f0e0d7 (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 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index e4482804dd..d1b40bed0f 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1559,12 +1559,17 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclPtrTy classDecl,
// should be true.
if (!ClassDecl)
return;
-
+
bool isInterfaceDeclKind =
isa<ObjCInterfaceDecl>(ClassDecl) || isa<ObjCCategoryDecl>(ClassDecl)
|| isa<ObjCProtocolDecl>(ClassDecl);
bool checkIdenticalMethods = isa<ObjCImplementationDecl>(ClassDecl);
+ if (!isInterfaceDeclKind && AtEndLoc.isInvalid()) {
+ AtEndLoc = ClassDecl->getLocation();
+ Diag(AtEndLoc, diag::warn_missing_atend);
+ }
+
DeclContext *DC = dyn_cast<DeclContext>(ClassDecl);
// FIXME: Remove these and use the ObjCContainerDecl/DeclContext.