mirror-llvm-project/flang/test/Semantics/io16.f90
Peter Klausler cbcaae2b5c
[flang] Warn about assumed-rank items in I/O lists (#182957)
An assumed-rank dummy argument is not a conforming I/O list or NAMELIST
group item. Add a -pedantic warning and some documentation.
2026-02-26 06:59:49 -08:00

15 lines
642 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
subroutine assumedRank(x, y)
real x(..), y(*)
!PORTABILITY: Assumed-rank object 'x' should not be a namelist group item [-Wassumed-rank-io-item]
!ERROR: A namelist group object 'y' must not be assumed-size
namelist /nml/x, y
!ERROR: Assumed-rank object 'x' may not be an I/O list item
!ERROR: Whole assumed-size array 'y' may not appear here without subscripts
read *, x, y
!ERROR: Assumed-rank object 'x' may not be an I/O list item
!ERROR: Whole assumed-size array 'y' may not appear here without subscripts
print *, x, y
read(*,nml=nml)
write(*,nml=nml)
end