aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d9cc727..82026b1 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -21597,6 +21597,17 @@ cp_parser_objc_interstitial_code (cp_parser* parser)
/* Allow stray semicolons. */
else if (token->type == CPP_SEMICOLON)
cp_lexer_consume_token (parser->lexer);
+ /* Mark methods as optional or required, when building protocols. */
+ else if (token->keyword == RID_AT_OPTIONAL)
+ {
+ cp_lexer_consume_token (parser->lexer);
+ objc_set_method_opt (true);
+ }
+ else if (token->keyword == RID_AT_REQUIRED)
+ {
+ cp_lexer_consume_token (parser->lexer);
+ objc_set_method_opt (false);
+ }
/* Finally, try to parse a block-declaration, or a function-definition. */
else
cp_parser_block_declaration (parser, /*statement_p=*/false);