Files
clang-p2996/flang/test/Semantics/bug144453.f90
Peter Klausler 348002e111 [flang] Check definability for logical INQUIRE specifiers (#144797)
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.
2025-06-30 10:21:06 -07:00

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