Array references like A(1) are commonly misparsed as function references, since the parser has almost no semantic context, and the parse tree is fixed up later by semantics once it can be disambiguated. In a case like A(I=1), however, the presence of an argument keyword must prevent conversion into an array reference. (It might still also be a structure constructor.) Differential Revision: https://reviews.llvm.org/D142765
9 lines
292 B
Fortran
9 lines
292 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror
|
|
! Ensure that a seemingly misparsed function reference is
|
|
! not converted to an array references of the same name if
|
|
! there's an argument keyword.
|
|
real array(1)
|
|
!ERROR: 'array' is not a callable procedure
|
|
print *, array(argument=1)
|
|
end
|