llvm-project/flang/test/Semantics/bug122002b.f90
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

14 lines
459 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
SUBROUTINE sub00(a,b,n,m)
complex(2) n,m
! ERROR: Must have INTEGER type, but is COMPLEX(2)
! ERROR: Must have INTEGER type, but is COMPLEX(2)
! ERROR: The type of 'b' has already been implicitly declared as REAL(4)
complex(3) a(n,m), b(size((LOG ((x * (a) - a + b / a - a))+1 - x)))
a = a ** n
! ERROR: DO controls should be INTEGER
DO 10 j = 1,m
a = n ** a
10 PRINT *, g
END SUBROUTINE sub00