aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r--gcc/c/c-parser.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index eba9bbf..c5e222b 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -13420,6 +13420,9 @@ c_parser_omp_clause_copyprivate (c_parser *parser, tree list)
/* OpenMP 2.5:
default ( none | shared )
+ OpenMP 5.1:
+ default ( private | firstprivate )
+
OpenACC:
default ( none | present ) */
@@ -13446,9 +13449,24 @@ c_parser_omp_clause_default (c_parser *parser, tree list, bool is_oacc)
break;
case 'p':
- if (strcmp ("present", p) != 0 || !is_oacc)
+ if (is_oacc)
+ {
+ if (strcmp ("present", p) != 0)
+ goto invalid_kind;
+ kind = OMP_CLAUSE_DEFAULT_PRESENT;
+ }
+ else
+ {
+ if (strcmp ("private", p) != 0)
+ goto invalid_kind;
+ kind = OMP_CLAUSE_DEFAULT_PRIVATE;
+ }
+ break;
+
+ case 'f':
+ if (strcmp ("firstprivate", p) != 0 || is_oacc)
goto invalid_kind;
- kind = OMP_CLAUSE_DEFAULT_PRESENT;
+ kind = OMP_CLAUSE_DEFAULT_FIRSTPRIVATE;
break;
case 's':
@@ -13469,7 +13487,8 @@ c_parser_omp_clause_default (c_parser *parser, tree list, bool is_oacc)
if (is_oacc)
c_parser_error (parser, "expected %<none%> or %<present%>");
else
- c_parser_error (parser, "expected %<none%> or %<shared%>");
+ c_parser_error (parser, "expected %<none%>, %<shared%>, "
+ "%<private%> or %<firstprivate%>");
}
parens.skip_until_found_close (parser);