As Fortran 2018 C1533, a nonintrinsic elemental procedure shall not be
used as an actual argument. The semantic check for implicit iterface is
missed.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Without this patch, the result is as follows:
$ cat sub.f90 subroutine sub(f) integer, external :: f print *, f() end $ flang-new sub.f90 -c $ cat main.f90 program m call sub(func) contains elemental integer function func() func = 1 end function end $ flang-new main.f90 -c $ cat test.f90 program m call sub(func) contains elemental integer function func() func = 1 end function end subroutine sub(f) integer, external :: f print *, f() end $ flang-new test.f90 -c ./test.f90:2:3: warning: If the procedure's interface were explicit, this reference would be in error: call sub(func) ^^^^^^^^^^^^^^ ./test.f90:2:12: because: Non-intrinsic ELEMENTAL procedure 'func' may not be passed as an actual argument call sub(func) ^^^^ ./test.f90:4:30: Declaration of 'func' elemental integer function func() ^^^^
flang/lib/Semantics/check-call.cpp | ||
---|---|---|
85 | It would be more clear if you either (1) combined the two if() statement predicates into one, or (2) moved the declaration of argProcSymbol into the predicate of the inner if() statement. |
Comment Actions
Fix the clang format using the new built clang-format. I used one old version causing the format issue previously.
It would be more clear if you either (1) combined the two if() statement predicates into one, or (2) moved the declaration of argProcSymbol into the predicate of the inner if() statement.