Skip to content

Commit 18b7deb

Browse files
committed
review feedback, plus an extra comment
1 parent cb45c67 commit 18b7deb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

flang/lib/Parser/openmp-parsers.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ template <typename A> struct NeverParser {
368368

369369
template <typename A> constexpr auto never() { return NeverParser<A>{}; }
370370

371+
// Parser for optional<T> which always succeeds and returns std::nullptr.
372+
// It's only needed to produce "std::optional<CallStmt::Chevrons>" in
373+
// CallStmt.
371374
template <typename A, typename B = void> struct NullParser;
372375
template <typename B> struct NullParser<std::optional<B>> {
373376
using resultType = std::optional<B>;
@@ -382,6 +385,7 @@ template <typename A> constexpr auto null() { return NullParser<A>{}; }
382385
// don't correspond to anything in the source. Their parsers should still
383386
// exist, but they should never be executed.
384387
TYPE_PARSER(construct<OmpStylizedDeclaration>(never<OmpStylizedDeclaration>()))
388+
TYPE_PARSER(construct<OmpStylizedInstance>(never<OmpStylizedInstance>()))
385389

386390
TYPE_PARSER( //
387391
construct<OmpStylizedInstance::Instance>(Parser<AssignmentStmt>{}) ||
@@ -391,8 +395,6 @@ TYPE_PARSER( //
391395
parenthesized(optionalList(actualArgSpec))))) ||
392396
construct<OmpStylizedInstance::Instance>(indirect(expr)))
393397

394-
TYPE_PARSER(construct<OmpStylizedInstance>(never<OmpStylizedInstance>()))
395-
396398
struct OmpStylizedExpressionParser {
397399
using resultType = OmpStylizedExpression;
398400

0 commit comments

Comments
 (0)