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

            Bug ID: 122306
           Summary: [OpenMP] Metadirective with function call in context
                    selector rejected
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: openmp, rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

Created attachment 62572
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62572&action=edit
testcase - compile with "-fopenmp"

The following program fails with a bogus

    8 |     !$omp&  when(user={condition(use_target()): target parallel do
map(f) reduction(+:f)) &
      |                                 1
Error: property must be a logical expression at (1)

Because 'use_target' is not known during parsing – but only later during
resolving the expression.


The problem is that the function is only defined after the calling
function, which is fine - but breaks when the resolving happens already
during parsing - as it is currently is done.

Reply via email to