public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/63674] New: procedure pointer and non/pure procedure
@ 2014-10-29 11:59 valeryweber at hotmail dot com
  2014-12-10 22:02 ` [Bug fortran/63674] " janus at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: valeryweber at hotmail dot com @ 2014-10-29 11:59 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-15 10:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-29 11:59 [Bug fortran/63674] New: procedure pointer and non/pure procedure valeryweber at hotmail dot com
2014-12-10 22:02 ` [Bug fortran/63674] " janus at gcc dot gnu.org
2014-12-10 22:12 ` janus at gcc dot gnu.org
2014-12-10 22:18 ` janus at gcc dot gnu.org
2014-12-14  9:33 ` [Bug fortran/63674] [F03] " janus at gcc dot gnu.org
2014-12-14 12:05 ` janus at gcc dot gnu.org
2014-12-14 12:07 ` janus at gcc dot gnu.org
2014-12-15 10:35 ` janus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).