public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45366]  New: Problem with abstract interface to PURE function
@ 2010-08-21 12:30 mrestelli at gmail dot com
  2010-08-22 10:50 ` [Bug fortran/45366] " janus at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mrestelli at gmail dot com @ 2010-08-21 12:30 UTC (permalink / raw)
  To: gcc-bugs

Hi all,
   gfortran refuses the attached code as

pure function i_g(x,p) result(y)
                     1
Error: Dummy procedure 'p' of PURE procedure at (1) must also be PURE

Notice however that i_f is an abstract interface to a PURE function.
(As a comment, ifort accepts the code.)


module m1
 implicit none
 abstract interface
  pure function i_f(x) result(y)
   real, intent(in) :: x
   real :: y
  end function i_f
 end interface
end module m1

module m2
 use m1, only: i_f
 implicit none
contains
 pure function i_g(x,p) result(y)
  real, intent(in) :: x
  procedure(i_f), pointer, intent(in) :: p
  real :: y
   y = p(x)
 end function i_g
end module m2


-- 
           Summary: Problem with abstract interface to PURE function
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mrestelli at gmail dot com
 GCC build triplet: GNU Fortran (GCC) 4.6.0 20100821 (experimental)
  GCC host triplet: AMD Turion(tm) 64 Mobile Technology ML-32 AuthenticAMD
                    GNU/Linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45366


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

end of thread, other threads:[~2010-08-23 12:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-21 12:30 [Bug fortran/45366] New: Problem with abstract interface to PURE function mrestelli at gmail dot com
2010-08-22 10:50 ` [Bug fortran/45366] " janus at gcc dot gnu dot org
2010-08-22 11:02 ` burnus at gcc dot gnu dot org
2010-08-22 11:10 ` janus at gcc dot gnu dot org
2010-08-23 12:27 ` [Bug fortran/45366] Problem with procedure pointer dummy in " janus at gcc dot gnu dot org
2010-08-23 12:29 ` janus at gcc dot gnu dot 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).