This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30865] optional argument passed on to size(...,dim=)
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Feb 2007 08:57:12 -0000
- Subject: [Bug fortran/30865] optional argument passed on to size(...,dim=)
- References: <bug-30865-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from burnus at gcc dot gnu dot org 2007-02-20 08:57 -------
> The following is legal but we segfault on execution:
> subroutine checkv(ires,a1,opt1)
> integer :: a1(:,:)
> integer, optional :: opt1
> ires = size (a1, dim=opt1)
For those who wonder (as I did) why using an optional argument is legal:
It is only used as actual argument corresponding to an optional dummy argument.
(cf. 12.4.1.6 in the Fortran 2003 standard).
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30865