public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/44616]  New: [OOP] ICE if CLASS(foo) is used before its definition
@ 2010-06-21 16:43 burnus at gcc dot gnu dot org
  2010-06-21 18:30 ` [Bug fortran/44616] " janus at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-06-21 16:43 UTC (permalink / raw)
  To: gcc-bugs

Reported by bd satish at http://gcc.gnu.org/ml/fortran/2010-06/msg00210.html

For the program, gfortran ICEs with:
  f951: internal compiler error: in find_typebound_proc_uop, at
  fortran/class.c:660

The failing assert is:
  gcc_assert (derived->f2k_derived);

Note: The original test case (see link) misses an IMPORT, cf. PR 44614.

The additional derived type is required -- and for the ICE it needs to come
before the actual definition, otherwise, it works.

module factory_pattern
implicit none

type First_Factory
    character(len=20) :: factory_type
    class(Connection), pointer :: connection_type
    contains
end type First_Factory

type, abstract :: Connection
    contains
    procedure(generic_desc), deferred :: description
end type Connection

abstract interface
    subroutine generic_desc(self)
        import  ! Required, cf. PR 44614
        class(Connection) :: self
    end subroutine generic_desc
end interface
end module factory_pattern


-- 
           Summary: [OOP] ICE if CLASS(foo) is used before its definition
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

end of thread, other threads:[~2010-06-22 17:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-21 16:43 [Bug fortran/44616] New: [OOP] ICE if CLASS(foo) is used before its definition burnus at gcc dot gnu dot org
2010-06-21 18:30 ` [Bug fortran/44616] " janus at gcc dot gnu dot org
2010-06-22 17:07 ` janus at gcc dot gnu dot org
2010-06-22 17:09 ` 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).