Peter Klausler 79670f168e
[flang] Improve scan for dummy argument type declarations (#172706)
We can handle a forward reference to an explicitly typed integer dummy
argument when its name appears in a specification expression, rather
than applying the active implicit typing rules, so long as the explicit
type declaration statement has a literal constant kind number. Extend
this to also accept INTEGER(int_ptr_kind()) or other function reference
without an actual argument.
2025-12-19 14:32:16 -08:00

11 lines
275 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
integer :: x
!ERROR: The type of 'x' has already been declared as INTEGER(4)
real :: x
integer(8) :: i
parameter(i=1,j=2,k=3)
integer :: j
!ERROR: The type of 'k' has already been implicitly declared as INTEGER(4)
real :: k
end