From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76424 invoked by alias); 2 Sep 2015 08:45:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 76363 invoked by uid 48); 2 Sep 2015 08:45:23 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/67431] ALLOCATE with SOURCE ignores overloaded assignment operator and uses intrinsic when copying values Date: Wed, 02 Sep 2015 08:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-09/txt/msg00127.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67431 Dominique d'Humieres changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2015-09-02 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres --- 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.