when compiling the following code with -DWITH_VALUE
$ flang problem.F90 -DWITH_VALUE && ./a.out
F90-S-0038-Symbol, input, has not been explicitly declared (problem.F90)
0 inform, 0 warnings, 1 severes, 0 fatal for subroutine_017
$ cat problem.F90
module module_017
implicit none
interface sub_017
module subroutine subroutine_017(input) ! interface defined here, body will be found in a submodule
implicit none
#if defined(WITH_VALUE)
integer, intent(IN), value :: input
#else
integer, intent(IN) :: input
#endif
end
end interface
end module
submodule (module_017) submodule_017 ! submodule whose parent is module_017
implicit none ! generates an error with some compilers with -DWITH_VALUE
contains
module procedure subroutine_017
print *,'subroutine_017 : input =', input
end
end submodule
program demo_017
use module_017
call sub_017(123)
end
$ flang problem.F90 && ./a.out
subroutine_017 : input = 123
(the nvidia nvfortran compiler exhibits the same problem)
(problem has been reported to nvidia)