public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/43388]  New: [F2008][OOP] ALLOCATE with MOLD=
Date: Tue, 16 Mar 2010 12:46:00 -0000	[thread overview]
Message-ID: <bug-43388-13404@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2010-03-16 12:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 12:46 burnus at gcc dot gnu dot org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-43388-13404@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).