From: steve on
F2008 has added MOLD to the possible alloc-opt entities allowed in an
allocate statement.

"R627 alloc-opt is ERRMSG = errmsg-variable
or MOLD = source-expr
or SOURCE = source-expr
or STAT = stat-variable"

C636 disallows multiple occurences of one of these entites in an
allocate
statement.

"C636 (R627) No alloc-opt shall appear more than once in a given alloc-
opt-list."

ALLOCATE(a, MOLD=b, MOLD=c) ! Illegal via C636

The question is whether MOLD and SOURCE can appear in the same
statement

! Is this legal?
ALLOCATE(a, MOLD=b, SOURCE=c)

In F2003, one finds C631

"C631 (R623) If SOURCE= appears, type-spec shall not appear and
allocation-list shall contain only
one allocate-object, which shall be type compatible (5.1.1.2)
with source-expr."

which clear means something of the form

ALLOCATE(INTEGER :: a, SOURCE=b)

is invalid. In F2008, one now finds

"C637 (R626) At most one of source-expr and type-spec shall appear."

which appears to be a rewrite of F2003's C631. So, does C637
disallow
MOLD and SOURCE in the same allocate, or does it means that
MOLD and SOURCE are not allowed when a type-spec is used?

--
steve