From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13659 invoked by alias); 29 Oct 2014 10:58:07 -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 13644 invoked by uid 48); 29 Oct 2014 10:58:04 -0000 From: "valeryweber at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/63674] New: procedure pointer and non/pure procedure Date: Wed, 29 Oct 2014 11:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: valeryweber at hotmail dot com X-Bugzilla-Status: UNCONFIRMED 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_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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: 2014-10/txt/msg02234.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63674 Bug ID: 63674 Summary: procedure pointer and non/pure procedure Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: valeryweber at hotmail dot com Dear All the following code is compiling fine with 4.9.1, but shouldnt gcc complain about calling a nonpure procedure from a pure one? v cat gcc_pure.f90 module test interface function func_interface ( ) RESULT( reslt ) INTEGER :: reslt end function func_interface end interface type :: t procedure(func_interface), nopass, pointer :: f => NULL() end type t contains function func_1 ( ) RESULT( reslt ) integer :: reslt reslt = 1 end function func_1 pure subroutine eval( a, reslt ) type(t), intent(in) :: a integer, intent(out) :: reslt reslt = a%f() !reslt = func_1() end subroutine eval end module test program prog use test type(t) :: a integer :: reslt a%f=>func_1 call eval(a,reslt) write(*,*) reslt end program prog gfortran-4.9.1 gcc_pure.f90 ./a.out 1