Peter Klausler fddadd2939
[flang] Address case of under-processed array symbol (#73169)
Array element references are frequently parsed as function references
due to the ambiguous syntax of Fortran, and the parse tree is repaired
by semantics once the relevant symbol table entries are in hand. This
patch fixes a case in which the correction takes a path that leaves the
type of a symbol undetermined, leading to later spurious errors in
expression analysis.

Fixes https://github.com/llvm/llvm-project/issues/68652.
2023-11-30 13:07:49 -08:00

12 lines
388 B
Fortran

! RUN: %python %S/test_symbols.py %s %flang_fc1
! Ensure that a misparsed function reference that turns out to be an
! array element reference still applies implicit typing, &c.
!DEF: /subr (Subroutine) Subprogram
subroutine subr
!DEF: /subr/moo (Implicit) ObjectEntity INTEGER(4)
common //moo(1)
!DEF: /subr/a ObjectEntity REAL(4)
!REF: /subr/moo
real a(moo(1))
end subroutine