public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43388]  New: [F2008][OOP] ALLOCATE with MOLD=
@ 2010-03-16 12:46 burnus at gcc dot gnu dot org
  2010-03-16 13:59 ` [Bug fortran/43388] " burnus at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-03-16 12:46 UTC (permalink / raw)
  To: gcc-bugs

F2003 supported
  ALLOCATE( A, SOURCE=B)
where the dynamic type of B determined the dynamic type of A plus where the
values where copied from B to A.

Fortran 2008 now also offers MOLD= where only the type is used, but no data is
copied.

Fortran 2008 draft FDIS: ftp://ftp.nag.co.uk/sc22wg5/N1801-N1850/N1814.pdf

R626 allocate-stmt is ALLOCATE ( [ type-spec :: ] allocation-list [,
alloc-opt-list ] )
R627 alloc-opt  is  ERRMSG = errmsg-variable
                or  MOLD = source-expr
                or  SOURCE = source-expr
                or  STAT = stat-variable

"If MOLD= appears and source-expr is a variable, its value need not be
defined."


And in the introduction one finds the following:

"A structure constructor can omit the value for an allocatable component.
SOURCE= in an ALLOCATE statement can give an array variable the bounds as well
as the value of an expression. MOLD= in an ALLOCATE statement can give a
polymorphic variable the shape, type, and type parameters of an expression
without copying the value."


-- 
           Summary: [F2008][OOP] ALLOCATE with MOLD=
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-15 18:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-16 12:46 [Bug fortran/43388] New: [F2008][OOP] ALLOCATE with MOLD= burnus at gcc dot gnu dot org
2010-03-16 13:59 ` [Bug fortran/43388] " burnus at gcc dot gnu dot org
2010-06-13  2:47 ` janus at gcc dot gnu dot org
2010-06-15 18:35 ` janus at gcc dot gnu dot org
2010-06-15 18:43 ` janus at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).