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/47350] New: Deferred string length: ALLOCATE should allow MOLD=


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.


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