This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44616] New: [OOP] ICE if CLASS(foo) is used before its definition
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jun 2010 16:43:40 -0000
- Subject: [Bug fortran/44616] New: [OOP] ICE if CLASS(foo) is used before its definition
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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