]> granicus.if.org Git - clang/commitdiff
implement gcc/testsuite/objc.dg/method-attribute-3.m, by improving error recovery.
authorChris Lattner <sabre@nondot.org>
Sun, 15 Feb 2009 22:24:30 +0000 (22:24 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 15 Feb 2009 22:24:30 +0000 (22:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64609 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseObjc.cpp
test/Parser/objc-interfaces.m [new file with mode: 0644]

index 210f33a5f7485cec9807f14229c1170a5a165e2a..4e4d009fe06f0ac39d65d2ff7b36c1480a5c9340 100644 (file)
@@ -239,7 +239,8 @@ void Parser::ParseObjCInterfaceDeclList(DeclTy *interfaceDecl,
       allMethods.push_back(methodPrototype);
       // Consume the ';' here, since ParseObjCMethodPrototype() is re-used for
       // method definitions.
-      ExpectAndConsume(tok::semi, diag::err_expected_semi_after_method_proto);
+      ExpectAndConsume(tok::semi, diag::err_expected_semi_after_method_proto,
+                       "", tok::semi);
       continue;
     }
     
diff --git a/test/Parser/objc-interfaces.m b/test/Parser/objc-interfaces.m
new file mode 100644 (file)
index 0000000..b13eea5
--- /dev/null
@@ -0,0 +1,8 @@
+// RUN: clang %s -fsyntax-only -verify
+
+// Test features and error recovery for objc interfaces.
+
+@interface INTF
+- (int*) foo2  __attribute__((deprecated)) : (int) x1 __attribute__((deprecated)); // expected-error {{expected ';' after method prototype}}
+@end
+