parser.c (cp_parser_omp_declare): Change return type to bool from void, return true...
authorJakub Jelinek <jakub@redhat.com>
Thu, 23 Nov 2017 20:18:10 +0000 (21:18 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 23 Nov 2017 20:18:10 +0000 (21:18 +0100)
* parser.c (cp_parser_omp_declare): Change return type to bool from
void, return true for declare simd.
(cp_parser_pragma): Return cp_parser_omp_declare returned value
rather than always false.

From-SVN: r255117

gcc/cp/ChangeLog
gcc/cp/parser.c

index ac623f0..e939641 100644 (file)
@@ -1,3 +1,10 @@
+2017-11-23  Jakub Jelinek  <jakub@redhat.com>
+
+       * parser.c (cp_parser_omp_declare): Change return type to bool from
+       void, return true for declare simd.
+       (cp_parser_pragma): Return cp_parser_omp_declare returned value
+       rather than always false.
+
 2017-11-23  Mike Stump  <mikestump@comcast.net>
            Eric Botcazou  <ebotcazou@adacore.com>
 
index 1ad351c..847ad14 100644 (file)
@@ -37903,7 +37903,7 @@ cp_parser_omp_declare_reduction (cp_parser *parser, cp_token *pragma_tok,
       initializer-clause[opt] new-line
    #pragma omp declare target new-line  */
 
-static void
+static bool
 cp_parser_omp_declare (cp_parser *parser, cp_token *pragma_tok,
                       enum pragma_context context)
 {
@@ -37917,7 +37917,7 @@ cp_parser_omp_declare (cp_parser *parser, cp_token *pragma_tok,
          cp_lexer_consume_token (parser->lexer);
          cp_parser_omp_declare_simd (parser, pragma_tok,
                                      context);
-         return;
+         return true;
        }
       cp_ensure_no_omp_declare_simd (parser);
       if (strcmp (p, "reduction") == 0)
@@ -37925,23 +37925,24 @@ cp_parser_omp_declare (cp_parser *parser, cp_token *pragma_tok,
          cp_lexer_consume_token (parser->lexer);
          cp_parser_omp_declare_reduction (parser, pragma_tok,
                                           context);
-         return;
+         return false;
        }
       if (!flag_openmp)  /* flag_openmp_simd  */
        {
          cp_parser_skip_to_pragma_eol (parser, pragma_tok);
-         return;
+         return false;
        }
       if (strcmp (p, "target") == 0)
        {
          cp_lexer_consume_token (parser->lexer);
          cp_parser_omp_declare_target (parser, pragma_tok);
-         return;
+         return false;
        }
     }
   cp_parser_error (parser, "expected %<simd%> or %<reduction%> "
                           "or %<target%>");
   cp_parser_require_pragma_eol (parser, pragma_tok);
+  return false;
 }
 
 /* OpenMP 4.5:
@@ -38860,8 +38861,7 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p)
       return false;
 
     case PRAGMA_OMP_DECLARE:
-      cp_parser_omp_declare (parser, pragma_tok, context);
-      return false;
+      return cp_parser_omp_declare (parser, pragma_tok, context);
 
     case PRAGMA_OACC_DECLARE:
       cp_parser_oacc_declare (parser, pragma_tok);