summaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-12 09:36:49 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-12 09:36:49 +0000
commitffbb3d61a9ec9a31adb5ac96cf05abb98835c8ba (patch)
tree94f847fad123463cc94e0e6a45f68519e3d44e56 /gcc/c-parser.c
parentcea7ac49b3d062f9dcbfa41b1aec4ad51e442635 (diff)
downloadgcc-ffbb3d61a9ec9a31adb5ac96cf05abb98835c8ba.tar.gz
In gcc/:
2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com> * c-parser.c (c_parser_objc_at_property_declaration): Improved error message. 2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com> * c-parser.c (c_lex_one_token): Updated and reindented some comments. No changes in code. In gcc/cp/: 2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com> * parser.c (cp_parser_objc_at_property_declaration): Improved error message. In gcc/testsuite/: 2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/property/at-property-29.m: New. * obj-c++.dg/property/at-property-29.mm: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168698 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index c9b529319ab..51df18886f4 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -253,8 +253,7 @@ c_lex_one_token (c_parser *parser, c_token *token)
/* We found an Objective-C "pq" keyword (in, out,
inout, bycopy, byref, oneway). They need special
care because the interpretation depends on the
- context.
- */
+ context. */
if (parser->objc_pq_context)
{
token->type = CPP_KEYWORD;
@@ -275,21 +274,19 @@ c_lex_one_token (c_parser *parser, c_token *token)
you can't use 'in' as the name of the running
variable in a C for loop. We could potentially
try to add code here to disambiguate, but it
- seems a reasonable limitation.
- */
+ seems a reasonable limitation. */
token->type = CPP_KEYWORD;
token->keyword = rid_code;
break;
}
/* Else, "pq" keywords outside of the "pq" context are
not keywords, and we fall through to the code for
- normal tokens.
- */
+ normal tokens. */
}
else if (c_dialect_objc () && OBJC_IS_PATTR_KEYWORD (rid_code))
{
- /* We found an Objective-C "property attribute" keyword
- (readonly, copies, getter, setter, ivar). These are
+ /* We found an Objective-C "property attribute"
+ keyword (getter, setter, readonly, etc). These are
only valid in the property context. */
if (parser->objc_property_attr_context)
{
@@ -310,8 +307,7 @@ c_lex_one_token (c_parser *parser, c_token *token)
protected, public, try, catch, throw) without a
preceding '@' sign. Do nothing and fall through to
the code for normal tokens (in C++ we would still
- consider the CXX ones keywords, but not in C).
- */
+ consider the CXX ones keywords, but not in C). */
;
}
else
@@ -7961,8 +7957,12 @@ c_parser_objc_at_property_declaration (c_parser *parser)
case RID_SETTER:
if (c_parser_next_token_is_not (parser, CPP_EQ))
{
- c_parser_error (parser,
- "getter/setter attribute must be followed by %<=%>");
+ if (keyword == RID_GETTER)
+ c_parser_error (parser,
+ "missing %<=%> (after %<getter%> attribute)");
+ else
+ c_parser_error (parser,
+ "missing %<=%> (after %<setter%> attribute)");
syntax_error = true;
break;
}