[flang] Better error recovery for missing THEN in IF construct
authorPeter Klausler <pklausler@nvidia.com>
Wed, 17 May 2023 14:57:38 +0000 (07:57 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Thu, 18 May 2023 18:41:07 +0000 (11:41 -0700)
commit60b673023f54e899c727e32414fd89b646a147e4
treef05e606c852a10fc53b32ee9802fba1dc4d50ea1
parentd624aba28bb5d3ad6e4078d536a94d26f1548144
[flang] Better error recovery for missing THEN in IF construct

Presented with "IF (...)" with no following tokens in the statement,
diagnose a missing "THEN" instead of complaining about all of the
possible action statement initial tokens that could have been there
for a non-construct IF statement.

Fixes https://github.com/llvm/llvm-project/issues/62299.

Differential Revision: https://reviews.llvm.org/D150783
flang/lib/Parser/executable-parsers.cpp
flang/test/Parser/missing-then.f90 [new file with mode: 0644]