Add `-fimplicit-none-type-always` to treat each specification-part like it has `IMPLICIT NONE`. This is helpful for enforcing good Fortran programming practices. We might consider something similar for `IMPLICIT NONE(EXTERNAL)` as well. Add `-fimplicit-none-type-never` to ignore occurrences of `IMPLICIT NONE` and `IMPLICIT NONE(TYPE)`. This is to handle cases like the one below, which violates the standard but it accepted by some compilers: ``` subroutine s(a, n) implicit none real :: a(n) integer :: n end ``` Differential Revision: https://reviews.llvm.org/D85363
12 lines
286 B
Fortran
12 lines
286 B
Fortran
! RUN: %S/test_errors.sh %s %t %f18 -fimplicit-none-type-never
|
|
subroutine s1
|
|
implicit none
|
|
i = j + k ! would be error without -fimplicit-none-type-never
|
|
end
|
|
|
|
subroutine s2(a, n)
|
|
implicit none
|
|
real :: a(n) ! would be error without -fimplicit-none-type-never
|
|
integer :: n
|
|
end
|