Files
clang-p2996/flang/test/Parser/elseif-then.f90
peter klausler 0061e681a3 [flang] Better error recovery for missing THEN in ELSE IF
The THEN keyword in the "ELSE IF (test) THEN" statement is useless
syntactically, and to omit it is a common error (at least for me!)
that has poor error recovery.  This patch changes the parser to
cough up a simple "expected 'THEN'" and still recognize the rest of
the IF construct.

Differential Revision: https://reviews.llvm.org/D110952
2021-10-04 09:37:53 -07:00

9 lines
170 B
Fortran

! RUN: not %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
! CHECK-NOT: expected '=>'
! CHECK: error: expected 'THEN'
if (.false.) then
else if (.false.)
else
end if
end