diff options
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index be29a27..c473e7f 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -40565,11 +40565,16 @@ cp_parser_omp_context_selector (cp_parser *parser, tree set, bool has_parms_p) if (score != error_mark_node) { score = fold_non_dependent_expr (score); - if (!value_dependent_expression_p (score) - && (!INTEGRAL_TYPE_P (TREE_TYPE (score)) - || !tree_fits_shwi_p (score))) + if (value_dependent_expression_p (score)) + properties = tree_cons (get_identifier (" score"), + score, properties); + else if (!INTEGRAL_TYPE_P (TREE_TYPE (score)) + || TREE_CODE (score) != INTEGER_CST) error_at (token->location, "score argument must be " "constant integer expression"); + else if (tree_int_cst_sgn (score) < 0) + error_at (token->location, "score argument must be " + "non-negative"); else properties = tree_cons (get_identifier (" score"), score, properties); |