This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/34231] Scalar actual not distinguished from assumed size formal argument



------- Comment #3 from burnus at gcc dot gnu dot org  2007-11-26 13:58 -------
> I think that the required F2003 survives correctly but
> I am having difficulty to find in the ChangeLog where this was added.

It was added for PR 30940.

> Tobias, what do you think?

Looks OK. At least the following works as expected and prints:
 two: character(*) scalar        ! finds right generic interface
 one: character(*), dimension(*) ! F2003 storage equivalence: ok for specific
                                 ! function.
 two: character(*) scalar        ! obviously ok.

And if one comments out "two" in "interface gen", one gets the expected
compile-time error.

MODULE test
  implicit none
   INTERFACE gen
      MODULE PROCEDURE one,two
   END INTERFACE
CONTAINS
   SUBROUTINE one(cnames)
      CHARACTER(*) :: cnames(*)
      write(*,*) 'one: character(*), dimension(*)'
   END SUBROUTINE one
   SUBROUTINE two(cname)
      CHARACTER(*) :: cname
      write(*,*) 'two: character(*) scalar'
   END SUBROUTINE two
END MODULE

PROGRAM main
  USE test
  CHARACTER(11) :: cname = 'Hello World'
  CALL gen(cname)
  CALL one(cname)
  CALL two(cname)
END PROGRAM


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34231


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]