This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47350] New: Deferred string length: ALLOCATE should allow MOLD=
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 18 Jan 2011 20:43:27 +0000
- Subject: [Bug fortran/47350] New: Deferred string length: ALLOCATE should allow MOLD=
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47350
Summary: Deferred string length: ALLOCATE should allow MOLD=
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
Currently, gfortran allows:
character(len=:) :: str, str2
ALLOCATE( str, SOURCE=str2)
but it does not allow for
ALLOCATE( str, MOLD=str2)
which fails with
Error: Allocate-object at (1) with a deferred type parameter requires either
a type-spec or SOURCE tag
Expected: MOLD (which is also a source-expr) is also accepted.
>From Fortran 2008 (which added MOLD=, which is already implemented in
gfortran):
C629 (R626) If any allocate-object has a deferred type parameter, is unlimited
polymorphic, or is of abstract type, either type-spec or source-expr shall
appear.
If source-expr is a pointer, it shall be associated with a target. If
source-expr is allocatable, it shall be allocated.
If MOLD= appears and source-expr is a variable, its value need not be defined.