https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118639

            Bug ID: 118639
           Summary: [OpenMP] c_parser_omp_variable_list wrongly accepts a
                    tailing comma: 'omp flush(a,)'
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic, openmp
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org, waffl3x at protonmail dot com
  Target Milestone: ---

GCC's C compiler accepts the following:

void f() {
  int a;
  #pragma omp flush(a,)
  #pragma omp allocate(a,)
}

While g++ rejects the ',)' with:
   error: expected unqualified-id before ‘)’ token

EXPECTED: Also the C compiler rejects this code.

(clang and clang++-19 oddly permit both the tailing comma with 'allocate' but
reject it for 'flush'.?!?)

Reply via email to