]> granicus.if.org Git - clang/commitdiff
Issues good diagnostic when @end is missing.
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 9 Nov 2010 20:38:00 +0000 (20:38 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 9 Nov 2010 20:38:00 +0000 (20:38 +0000)
// rdar://8283484

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118629 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseObjc.cpp
test/Parser/missing-end-3.m [new file with mode: 0644]

index a8f5e222dc8eaa5159862e442ce77cf8eb2d36c8..3475602c9572afe679904c3df760debc2161baf5 100644 (file)
@@ -404,6 +404,7 @@ void Parser::ParseObjCInterfaceDeclList(Decl *interfaceDecl,
       break;
         
     case tok::objc_implementation:
+    case tok::objc_interface:
       Diag(Tok, diag::err_objc_missing_end);
       ConsumeToken();
       break;
diff --git a/test/Parser/missing-end-3.m b/test/Parser/missing-end-3.m
new file mode 100644 (file)
index 0000000..3b22637
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// rdar://8283484
+@interface blah {
+    @private
+}
+// since I forgot the @end here it should say something
+
+@interface blah  // expected-error {{missing @end}}
+@end // and Unknown type name 'end' here
+