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
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index 989f1dc..34694ef 100644
--- a/Parse/ParseObjc.cpp
+++ b/Parse/ParseObjc.cpp
@@ -991,13 +991,10 @@
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;
}