When a TYPE(*) dummy argument is erroneously used as a component value in a structure constructor, semantics crashes if the structure constructor had been initially parsed as a potential function reference. Clean out stale typed expressions when reanalyzing the reconstructed parse subtree to ensure that errors are caught the next time around.
11 lines
237 B
Fortran
11 lines
237 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
! Regression test for crash
|
|
subroutine sub(xx)
|
|
type(*) :: xx
|
|
type ty
|
|
end type
|
|
type(ty) obj
|
|
!ERROR: TYPE(*) dummy argument may only be used as an actual argument
|
|
obj = ty(xx)
|
|
end
|