[all-commits] [llvm/llvm-project] 26fc3a: [OpenMP] Missing implicit otherwise clause in meta...

Zahira Ammarguellat via All-commits all-commits at lists.llvm.org
Fri Feb 28 05:02:57 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 26fc3aa983ab4615dfc32cebf74076c118de2a9d
      https://github.com/llvm/llvm-project/commit/26fc3aa983ab4615dfc32cebf74076c118de2a9d
  Author: Zahira Ammarguellat <zahira.ammarguellat at intel.com>
  Date:   2025-02-28 (Fri, 28 Feb 2025)

  Changed paths:
    M clang/lib/Parse/ParseOpenMP.cpp
    M clang/test/OpenMP/metadirective_ast_print.c
    A clang/test/OpenMP/metadirective_otherwise.cpp
    M llvm/include/llvm/Frontend/OpenMP/OMPContext.h

  Log Message:
  -----------
  [OpenMP] Missing implicit otherwise clause in metadirective. (#127113)

Compiling this:
 `int main() {`
 ` #pragma omp metadirective when(use r= {condition(0)}`
`: parallel for)`
  `for (int i=0; i<10; i++)`
  ;
}`

is generating an error:
`error: expected expression`
The compiler is interpreting this as if it's compiling a `#pragma omp
metadirective` with no `otherwise` clause.
In the OMP5.2 specs chapter 7.4 it's mentioned that: 
`If no otherwise clause is specified the effect is as if one was
specified without an associated directive variant.`
This patch fixes the issue.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list