http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60804

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The following should disallow this in the C FE.

diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 5653e49..cbbb272 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -5153,6 +5153,9 @@ c_parser_if_statement (c_parser *parser)
   /* If the if statement contains array notations, then we expand them.  */
   if (flag_cilkplus && contains_array_notation_expr (if_stmt))
     if_stmt = fix_conditional_array_notations (if_stmt);
+  /* But Cilk_spawn in controlling expression is invalid.  */
+  if (flag_cilkplus && contains_cilk_spawn_stmt (cond))
+    error_at (loc, "%<_Cilk_spawn%> in if statement is not permitted");
   add_stmt (if_stmt);
 }

Reply via email to