diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-10-28 11:03:56 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-10-28 11:03:56 +0200 |
commit | 89999f2358724fa4e71c7c3b4de340582c0e43da (patch) | |
tree | 86a55ecdb10d3428be8409deeace51bb8fd268f8 /libphobos/src/std/algorithm/comparison.d | |
parent | 826df6d0cc706bf83cdb228b43f9b4890e8b2fbd (diff) | |
download | gcc-89999f2358724fa4e71c7c3b4de340582c0e43da.zip gcc-89999f2358724fa4e71c7c3b4de340582c0e43da.tar.gz gcc-89999f2358724fa4e71c7c3b4de340582c0e43da.tar.bz2 |
openmp: Allow optional comma after directive-specifier in C/C++
Previously we've been allowing that comma only in C++ when in attribute
form (which was the reason why it has been allowed), but 5.1 allows that
even in pragma form in C/C++ (with clarifications in 5.2) and 5.2
also in Fortran (which this patch doesn't implement).
Note, for directives which take an argument (== unnamed clause),
comma is not allowed in between the directive name and the argument,
like the directive-1.c testcase shows.
2022-10-28 Jakub Jelinek <jakub@redhat.com>
gcc/c/
* c-parser.cc (c_parser_omp_all_clauses): Allow optional
comma before the first clause.
(c_parser_omp_allocate, c_parser_omp_atomic, c_parser_omp_depobj,
c_parser_omp_flush, c_parser_omp_scan_loop_body,
c_parser_omp_ordered, c_finish_omp_declare_variant,
c_parser_omp_declare_target, c_parser_omp_declare_reduction,
c_parser_omp_requires, c_parser_omp_error,
c_parser_omp_assumption_clauses): Likewise.
gcc/cp/
* parser.cc (cp_parser_omp_all_clauses): Allow optional comma
before the first clause even in pragma syntax.
(cp_parser_omp_allocate, cp_parser_omp_atomic, cp_parser_omp_depobj,
cp_parser_omp_flush, cp_parser_omp_scan_loop_body,
cp_parser_omp_ordered, cp_parser_omp_assumption_clauses,
cp_finish_omp_declare_variant, cp_parser_omp_declare_target,
cp_parser_omp_declare_reduction_exprs, cp_parser_omp_requires,
cp_parser_omp_error): Likewise.
gcc/testsuite/
* c-c++-common/gomp/directive-1.c: New test.
* c-c++-common/gomp/clauses-6.c: New test.
* c-c++-common/gomp/declare-variant-2.c (f75a): Declare.
(f75): Use f75a as variant instead of f1 and don't expect error.
* g++.dg/gomp/clause-4.C (foo): Don't expect error on comma
before first clause.
* gcc.dg/gomp/clause-2.c (foo): Likewise.
Diffstat (limited to 'libphobos/src/std/algorithm/comparison.d')
0 files changed, 0 insertions, 0 deletions