diff options
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 8c61520..c3016bc 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -5803,7 +5803,13 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, postfix_expression = cp_parser_postfix_expression (parser, false, false, false, false, &idk); - if (saved_in_statement & IN_CILK_SPAWN) + if (!flag_enable_cilkplus) + { + error_at (token->location, "-fcilkplus must be enabled to use" + " %<_Cilk_spawn%>"); + cfun->calls_cilk_spawn = 0; + } + else if (saved_in_statement & IN_CILK_SPAWN) { error_at (token->location, "consecutive %<_Cilk_spawn%> keywords " "are not permitted"); @@ -5830,8 +5836,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, finish_expr_stmt (sync_expr); } else - error_at (input_location, "_Cilk_sync cannot be used without enabling " - "Cilk Plus"); + error_at (token->location, "-fcilkplus must be enabled to use" + " %<_Cilk_sync%>"); cp_lexer_consume_token (parser->lexer); break; |