Commit 4e4edb3b by Iain Sandoe

fix cut & paste error in cp/parser and add testscases in case of fture error.

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
parent feab3549
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> 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
Merge from apple/trunk branch on FSF servers. Merge from apple/trunk branch on FSF servers.
......
...@@ -21568,6 +21568,7 @@ cp_parser_objc_method_tail_params_opt (cp_parser* parser, bool *ellipsisp, ...@@ -21568,6 +21568,7 @@ cp_parser_objc_method_tail_params_opt (cp_parser* parser, bool *ellipsisp,
{ {
cp_lexer_consume_token (parser->lexer); /* Eat '...'. */ cp_lexer_consume_token (parser->lexer); /* Eat '...'. */
*ellipsisp = true; *ellipsisp = true;
token = cp_lexer_peek_token (parser->lexer);
break; break;
} }
......
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> 2010-10-07 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/45916 PR fortran/45916
......
/* { 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];
}
/* { 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];
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment