From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2577 invoked by alias); 2 Dec 2013 22:10:04 -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 1813 invoked by uid 48); 2 Dec 2013 22:09:23 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/58099] [4.8/4.9 Regression] [F03] over-zealous procedure-pointer error checking Date: Mon, 02 Dec 2013 22:10: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: unknown X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: janus at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: 2013-12/txt/msg00122.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58099 --- Comment #26 from Tobias Burnus --- (In reply to janus from comment #25) > The relevant quote for the above error message is F08:12.4.2.2, which says: Good pointer, though I am not sure whether it is relevant. Another one is "12.4.3.6 Procedure declaration statement" which is relevant for the interface declaration part of the proc-pointer. * * * With some digging I found 09-166 - but according to the m188 notes no further action is done. And a bit less fitting but with passed J3/WG5, one has: 09-171r1, which got revised as 09-217 and passed the ballot as Interpretation Request F03-0130. See: http://j3-fortran.org/doc/year/09/09-217.txt and http://j3-fortran.org/doc/year/10/10-006T5r1.txt. >>From F03-0130: Q: "When one of these procedures [i.e. the specific intrinsic procedures listed in 13.6 and not marked with a bullet] is associated with a dummy procedure or procedure pointer, does it still have the elemental property?" A: "The specific intrinsic procedure itself retains the elemental property (so a reference using its own name can be elemental), but the dummy procedure or procedure pointer associated with it is not elemental and so cannot be used to reference the specific intrinsic procedure elementally." * * * As far as I can see, it seems to be valid to have: intrinsic :: sin procedure(real), pointer :: pp1 => sin procedure(sin), pointer :: pp2 => sin ! valid per C1216 interface pure function sin_like(x) real, intent(in) :: x end function sin_like end interface procedure(sin_like), pointer :: pp3 => sin But in all cases, the proc-pointer is not elemental. It doesn't seem to be valid to have: interface pure ELEMENTAL function sin_like(x) real, intent(in) :: x end function sin_like end interface procedure(sin_like), pointer :: pp4 => sin But is is valid to have a non-proc-pointer PROCEDURE statement like: procedure(sin_like) :: external_sin_like_function For the latter two, the following applies: "C1218 (R1211) If a proc-interface describes an elemental procedure, each procedure-entity-name shall specify an external procedure." [Side note: We should also check that dummy arguments are correctly handled.]