diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp index 6d1a3a04b481e..b30a3a1eb2a15 100644 --- a/flang/lib/Parser/openmp-parsers.cpp +++ b/flang/lib/Parser/openmp-parsers.cpp @@ -610,7 +610,7 @@ TYPE_PARSER( // 2.4 Requires construct TYPE_PARSER(sourced(construct( - verbatim("REQUIRES"_tok), some(Parser{} / maybe(","_tok))))) + verbatim("REQUIRES"_tok), Parser{}))) // 2.15.2 Threadprivate directive TYPE_PARSER(sourced(construct( diff --git a/flang/test/Semantics/OpenMP/requires.f90 b/flang/test/Semantics/OpenMP/requires.f90 index e2093ec503266..007135749cc82 100644 --- a/flang/test/Semantics/OpenMP/requires.f90 +++ b/flang/test/Semantics/OpenMP/requires.f90 @@ -1,4 +1,7 @@ ! RUN: %python %S/../test_errors.py %s %flang -fopenmp -!$omp requires reverse_offload +!$omp requires reverse_offload unified_shared_memory + +!ERROR: NOWAIT clause is not allowed on the REQUIRES directive +!$omp requires nowait end