+2011-10-15 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ Backport from mainline
+ 2011-06-06 Nicola Pero <nicola.pero@meta-innovation.com>,
+
+ PR obj-c++/48275
+ * parser.c (cp_parser_objc_at_property_declaration): Allow setter
+ and getter names to use all the allowed method names.
+
2011-10-13 Jason Merrill <jason@redhat.com>
PR c++/50618
break;
}
cp_lexer_consume_token (parser->lexer); /* eat the = */
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_NAME))
+ if (!cp_parser_objc_selector_p (cp_lexer_peek_token (parser->lexer)->type))
{
cp_parser_error (parser, "expected identifier");
syntax_error = true;
if (keyword == RID_SETTER)
{
if (property_setter_ident != NULL_TREE)
- cp_parser_error (parser, "the %<setter%> attribute may only be specified once");
+ {
+ cp_parser_error (parser, "the %<setter%> attribute may only be specified once");
+ cp_lexer_consume_token (parser->lexer);
+ }
else
- property_setter_ident = cp_lexer_peek_token (parser->lexer)->u.value;
- cp_lexer_consume_token (parser->lexer);
+ property_setter_ident = cp_parser_objc_selector (parser);
if (cp_lexer_next_token_is_not (parser->lexer, CPP_COLON))
cp_parser_error (parser, "setter name must terminate with %<:%>");
else
else
{
if (property_getter_ident != NULL_TREE)
- cp_parser_error (parser, "the %<getter%> attribute may only be specified once");
+ {
+ cp_parser_error (parser, "the %<getter%> attribute may only be specified once");
+ cp_lexer_consume_token (parser->lexer);
+ }
else
- property_getter_ident = cp_lexer_peek_token (parser->lexer)->u.value;
- cp_lexer_consume_token (parser->lexer);
+ property_getter_ident = cp_parser_objc_selector (parser);
}
break;
default:
+2011-10-15 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ Backport from mainline
+ 2011-06-06 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR objc-++/48275
+ * obj-c++.dg/property/cxx-property-1.mm: New.
+ * obj-c++.dg/property/cxx-property-2.mm: New.
+
2011-10-15 Tobias Burnus <burnus@net-b.de>
PR fortran/50718
--- /dev/null
+/* { dg-do compile } */
+
+/* All these C++ keywords are acceptable in ObjC method names, hence
+ should be accepted for property getters and setters. */
+
+@interface Test
+{
+ Class isa;
+}
+@property (getter=namespace) int p0;
+@property (setter=namespace:) int p1;
+@property (getter=and) int p2;
+@property (setter=and:) int p3;
+@property (getter=class) int p4;
+@property (setter=class:) int p5;
+@property (getter=new) int p6;
+@property (setter=new:) int p7;
+@property (getter=delete) int p8;
+@property (setter=delete:) int p9;
+@property (getter=delete) int p10;
+@property (setter=delete:) int p11;
+@end