+2014-05-21 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR c/60189
+ * parser.c (cp_parser_postfix_expression): Move handling of cilk_sync
+ from here to...
+ (cp_parser_statement): ...here. Make sure only semicolon can go after
+ Cilk_sync.
+
2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58753
}
break;
}
-
- case RID_CILK_SYNC:
- if (flag_cilkplus)
- {
- tree sync_expr = build_cilk_sync ();
- SET_EXPR_LOCATION (sync_expr,
- cp_lexer_peek_token (parser->lexer)->location);
- finish_expr_stmt (sync_expr);
- }
- else
- error_at (token->location, "-fcilkplus must be enabled to use"
- " %<_Cilk_sync%>");
- cp_lexer_consume_token (parser->lexer);
- break;
case RID_BUILTIN_SHUFFLE:
{
statement = cp_parser_jump_statement (parser);
break;
+ case RID_CILK_SYNC:
+ cp_lexer_consume_token (parser->lexer);
+ if (flag_cilkplus)
+ {
+ tree sync_expr = build_cilk_sync ();
+ SET_EXPR_LOCATION (sync_expr,
+ token->location);
+ statement = finish_expr_stmt (sync_expr);
+ }
+ else
+ {
+ error_at (token->location, "-fcilkplus must be enabled to use"
+ " %<_Cilk_sync%>");
+ statement = error_mark_node;
+ }
+ cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
+ break;
+
/* Objective-C++ exception-handling constructs. */
case RID_AT_TRY:
case RID_AT_CATCH:
+2014-05-21 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR c++/60189
+ * c-c++-common/cilk-plus/CK/invalid_sync.cÑ: New test.
+
2014-05-20 Jan Hubicka <hubicka@ucw.cz>
PR tree-optimization/60899