https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119074

--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(In reply to Thomas Koenig from comment #1)
> Hmm... an interesting question:
> 
> Does
> 
> subroutine foo(f,n)
>   external f
>   if (n .eq. 1) call f(1)
>   if (n .eq. 2) call f(1,2)
> end
> 
> comply?

After looking at the standard, I think this should be valid.

Maybe commit the following as a test case, to make sure that
nothing goes amiss:

program main
  external ex1,ex2
  call foo(ex1,1)
  call foo(ex2,2)
end program main

subroutine ex1(n)
  integer :: n
  if (n /= 1) error stop
end subroutine ex1

subroutine ex2(n,m)
  integer :: n,m
  if (n /= 2) error stop
  if (m /= 3) error stop
end subroutine ex2

subroutine foo(a,n)
  external a
  if (n == 1) call a(1)
  if (n == 2) call a(2,3)
end subroutine foo

Reply via email to