@@ -1279,9 +1279,6 @@ TYPE_PARSER(sourced(construct<OmpClauseList>(
12791279// 2.1 (variable | /common-block/ | array-sections)
12801280TYPE_PARSER(construct<OmpObjectList>(nonemptyList(Parser<OmpObject>{})))
12811281
1282- TYPE_PARSER(sourced(construct<OmpErrorDirective>(
1283- verbatim("ERROR"_tok), Parser<OmpClauseList>{})))
1284-
12851282// --- Parsers for directives and constructs --------------------------
12861283
12871284static inline constexpr auto IsDirective(llvm::omp::Directive dir) {
@@ -1368,13 +1365,19 @@ struct LooselyStructuredBlockParser {
13681365 }
13691366};
13701367
1371- TYPE_PARSER(sourced(construct<OmpNothingDirective>("NOTHING" >> ok)))
1368+ TYPE_PARSER(construct<OmpErrorDirective>(
1369+ predicated(Parser<OmpDirectiveName>{},
1370+ IsDirective(llvm::omp::Directive::OMPD_error)) >=
1371+ Parser<OmpDirectiveSpecification>{}))
13721372
1373- TYPE_PARSER(sourced(construct<OpenMPUtilityConstruct>(
1374- sourced(construct<OpenMPUtilityConstruct>(
1375- sourced(Parser<OmpErrorDirective>{}))) ||
1376- sourced(construct<OpenMPUtilityConstruct>(
1377- sourced(Parser<OmpNothingDirective>{}))))))
1373+ TYPE_PARSER(construct<OmpNothingDirective>(
1374+ predicated(Parser<OmpDirectiveName>{},
1375+ IsDirective(llvm::omp::Directive::OMPD_nothing)) >=
1376+ Parser<OmpDirectiveSpecification>{}))
1377+
1378+ TYPE_PARSER( //
1379+ sourced(construct<OpenMPUtilityConstruct>(Parser<OmpErrorDirective>{})) ||
1380+ sourced(construct<OpenMPUtilityConstruct>(Parser<OmpNothingDirective>{})))
13781381
13791382TYPE_PARSER(construct<OmpMetadirectiveDirective>(
13801383 predicated(Parser<OmpDirectiveName>{},
0 commit comments