check-io.cpp was missing checks for the definability of logical-valued specifiers in INQUIRE statements (e.g. EXIST=), and therefore also not noting the definitions of those variables. This could lead to bogus warnings about undefined function result variables, and also to missed errors about immutable objects appearing in those specifiers. Fixes https://github.com/llvm/llvm-project/issues/144453.
11 lines
417 B
Fortran
11 lines
417 B
Fortran
!RUN: %python %S/test_errors.py %s %flang_fc1
|
|
function func(immutable)
|
|
logical func
|
|
logical, intent(in) :: immutable
|
|
!No warning about an undefined function result should appear
|
|
INQUIRE(file="/usr/local/games/adventure", EXIST=func)
|
|
!ERROR: EXIST variable 'immutable' is not definable
|
|
!BECAUSE: 'immutable' is an INTENT(IN) dummy argument
|
|
INQUIRE(file="/usr/local/games/adventure", EXIST=immutable)
|
|
end
|