public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/56939] New: [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined
@ 2013-04-12 19:08 janus at gcc dot gnu.org
  2013-04-12 19:40 ` [Bug fortran/56939] " janus at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: janus at gcc dot gnu.org @ 2013-04-12 19:08 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56939
           Summary: [4.8/4.9 Regression] [OOP] Derived type is being used
                    before it is defined
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: janus@gcc.gnu.org


The following is a reduction of PR 55959 comment 0, which is valid code AFAICS:


module pdfs
  type, abstract :: pdf
    integer dims
  contains
    procedure(getx), deferred :: getx
  end type

  abstract interface
    function getx(this)
      import pdf
      class(pdf), intent(in) :: this
      real getx(this%dims)
    end function
  end interface

  type point
    real x, y
  end type

  type, extends(pdf) :: pdf_point
    type(point) p
  contains
    procedure :: getx => pdf_point_getx
  end type

contains

  function pdf_point_getx(this)
    class(pdf_point), intent(in) :: this
    real pdf_point_getx(this%dims)
  end function

end module pdfs


program abstract
  use pdfs
end program


With 4.8 and trunk it gives the nonsensical error message:

  use pdfs
      1
Error: Derived type 'pdf' at (1) is being used before it is defined

(while 4.7 accepts it without a problem.)


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

end of thread, other threads:[~2013-06-11 18:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-12 19:08 [Bug fortran/56939] New: [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined janus at gcc dot gnu.org
2013-04-12 19:40 ` [Bug fortran/56939] " janus at gcc dot gnu.org
2013-05-15 13:27 ` rguenth at gcc dot gnu.org
2013-05-31 11:00 ` jakub at gcc dot gnu.org
2013-06-11 17:18 ` mikael at gcc dot gnu.org
2013-06-11 18:04 ` dominiq at lps dot ens.fr

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).