[Bug fortran/67431] ALLOCATE with SOURCE ignores overloaded assignment operator and uses intrinsic when copying values
dominiq at lps dot ens.fr
gcc-bugzilla@gcc.gnu.org
Wed Sep 2 08:45:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67431
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2015-09-02
Ever confirmed|0 |1
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
In the standard I see
6.7.1.2 Execution of an ALLOCATE statement
...
7 If SOURCE= appears, source-expr shall be conformable with allocation.
If the value of a nondeferred length type parameter of allocate-object
is different from the value of the corresponding type parameter of
source-expr,
an error condition occurs. On successful allocation, if allocate-object
and source-expr have the same rank the value of allocate-object becomes that
of source-expr, otherwise the value of each element of allocate-object
becomes
that of source-expr.
6.7.1.3 Allocation of allocatable variables
...
5 When an object of derived type is created by an ALLOCATE statement,
any allocatable ultimate components have an allocation status of unallocated
unless the SOURCE= specier appears and the corresponding component
of the source-expr is allocated.
i.e., there is no reference to overloaded assignment in the above quotations.
IMO your expectation is wrong, the gfortran behavior is correct and this PR
should be closed as INVALID unless you are able to point to a place in the
standard that support your expectation.
More information about the Gcc-bugs
mailing list