Hi!

In this case, even the parsing isn't finished (while the modifier is parsed,
if there is the modifier, there must be scan directive in the body etc.).

This patch emits a sorry.

Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk.

2018-11-09  Jakub Jelinek  <ja...@redhat.com>

        * c-parser.c (c_parser_omp_clause_reduction): Call sorry_at on
        reduction clause with inscan modifier.

        * parser.c (cp_parser_omp_clause_reduction): Call sorry_at on
        reduction clause with inscan modifier.

--- gcc/c/c-parser.c.jj 2018-11-09 16:01:53.406548059 +0100
+++ gcc/c/c-parser.c    2018-11-09 17:17:05.454216557 +0100
@@ -13280,7 +13280,11 @@ c_parser_omp_clause_reduction (c_parser
              if (strcmp (p, "task") == 0)
                task = true;
              else if (strcmp (p, "inscan") == 0)
-               inscan = true;
+               {
+                 inscan = true;
+                 sorry ("%<inscan%> modifier on %<reduction%> clause "
+                        "not supported yet");
+               }
              if (task || inscan)
                {
                  c_parser_consume_token (parser);
--- gcc/cp/parser.c.jj  2018-11-09 16:02:30.582935064 +0100
+++ gcc/cp/parser.c     2018-11-09 17:18:47.887528746 +0100
@@ -33115,7 +33115,11 @@ cp_parser_omp_clause_reduction (cp_parse
          if (strcmp (p, "task") == 0)
            task = true;
          else if (strcmp (p, "inscan") == 0)
-           inscan = true;
+           {
+             inscan = true;
+             sorry ("%<inscan%> modifier on %<reduction%> clause "
+                    "not supported yet");
+           }
          if (task || inscan)
            {
              cp_lexer_consume_token (parser->lexer);

        Jakub

Reply via email to