Waffl3x wrote:
The OpenMP allocate directive is not a construct, and thus is not supposed
to be handled by cp_parser_omp_construct,
...

gcc/cp/ChangeLog:

        * parser.cc (cp_parser_omp_construct)
        <case PRAGMA_OMP_ALLOCATE>: Remove.
        (cp_parser_pragma): Add comments.


--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -56537,9 +56537,6 @@ cp_parser_omp_construct (cp_parser *parser, cp_token 
*pragma_tok, bool *if_p)
      case PRAGMA_OACC_WAIT:
        stmt = cp_parser_oacc_wait (parser, pragma_tok);
        break;
-    case PRAGMA_OMP_ALLOCATE:
-      cp_parser_omp_allocate (parser, pragma_tok);
-      return;
      case PRAGMA_OMP_ATOMIC:
        cp_parser_omp_atomic (parser, pragma_tok, false);
        return;

Well spotted. Thanks!


@@ -57249,7 +57246,9 @@ cp_parser_pragma (cp_parser *parser, enum 
pragma_context context, bool *if_p)
        cp_parser_omp_construct (parser, pragma_tok, if_p);
        return true;
      case PRAGMA_OMP_ALLOCATE:
+      /* The allocate directive is not a construct.  */
        cp_parser_omp_allocate (parser, pragma_tok);
+      /* EOL is handled in cp_parser_omp_allocate, don't break.  */
        return false;

The first one is IMHO more confusing than helpful - it is true for
about a third of the directives listed - i.e. both construct and
non-constructs are handled here.

I think the second comment is not needed (true for about half of the
directives in this function + both its the only thing done after the
switch statement) - however, it also does not really harm.

Otherwise, LGTM.

Tobias

Reply via email to