]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
fix cut & paste error in cp/parser and add testscases in case of fture error.
authorIain Sandoe <iains@gcc.gnu.org>
Thu, 7 Oct 2010 13:51:38 +0000 (13:51 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Thu, 7 Oct 2010 13:51:38 +0000 (13:51 +0000)
gcc/cp:

parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
finding ellipsis, before checking for attributes.

testsuite:

* objc.dg/attributes/method-attribute-3.m: New.
* obj-c++.dg/attributes/method-attribute-3.mm: New.

From-SVN: r165109

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/obj-c++.dg/attributes/method-attribute-3.mm [new file with mode: 0644]
gcc/testsuite/objc.dg/attributes/method-attribute-3.m [new file with mode: 0644]

index 6219f041484dcb55da79cd13caac73b04285ff8a..ac07e63fefee1d5e43e03a5ead6337beeb23860d 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-07  Iain Sandoe  <iains@gcc.gnu.org>
+
+       parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
+       finding ellipsis, before checking for attributes.
+
 2010-10-06  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        Merge from apple/trunk branch on FSF servers.
index 7e251570753252923231f0789cbffc96452f9887..6c842df2437e564486fe54a8253b1c6ad210f325 100644 (file)
@@ -21568,6 +21568,7 @@ cp_parser_objc_method_tail_params_opt (cp_parser* parser, bool *ellipsisp,
        {
          cp_lexer_consume_token (parser->lexer);  /* Eat '...'.  */
          *ellipsisp = true;
+         token = cp_lexer_peek_token (parser->lexer);
          break;
        }
 
index bedc124192e2c939ec9fed3e6ce69fae898cc3b3..a07e2e4de695ed8414fc286d22796ce0b8fef57c 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-07  Iain Sandoe  <iains@gcc.gnu.org>
+
+       * objc.dg/attributes/method-attribute-3.m: New.
+       * obj-c++.dg/attributes/method-attribute-3.mm: New.
+
 2010-10-07  Mikael Morin  <mikael@gcc.gnu.org>
 
        PR fortran/45916
diff --git a/gcc/testsuite/obj-c++.dg/attributes/method-attribute-3.mm b/gcc/testsuite/obj-c++.dg/attributes/method-attribute-3.mm
new file mode 100644 (file)
index 0000000..05b9884
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+#include "../../objc-obj-c++-shared/Object1.h"
+
+@interface obj : Object {
+@public 
+  int var;
+}
+- (int) vargsn: (int) count, ... __attribute__((deprecated)); /* { dg-warning " method attributes are not available in this version of the compiler" } */
+@end
+
+@implementation obj
+- (int) vargsn: (int) count, ... 
+{
+  return 0;
+}
+@end 
+
+int foo (void)
+{
+  obj *p = [obj new];
+  
+  return [p vargsn:0];
+}
diff --git a/gcc/testsuite/objc.dg/attributes/method-attribute-3.m b/gcc/testsuite/objc.dg/attributes/method-attribute-3.m
new file mode 100644 (file)
index 0000000..05b9884
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+#include "../../objc-obj-c++-shared/Object1.h"
+
+@interface obj : Object {
+@public 
+  int var;
+}
+- (int) vargsn: (int) count, ... __attribute__((deprecated)); /* { dg-warning " method attributes are not available in this version of the compiler" } */
+@end
+
+@implementation obj
+- (int) vargsn: (int) count, ... 
+{
+  return 0;
+}
+@end 
+
+int foo (void)
+{
+  obj *p = [obj new];
+  
+  return [p vargsn:0];
+}