gfortran crash while compiling abstract data types
bd satish
bdsatish@gmail.com
Mon Jun 21 17:12:00 GMT 2010
Thanks Tobais !
Adding an IMPORT statement makes no effect. The same ICE still occurs.
abstract interface
subroutine generic_desc(self)
import :: Connection !! Adding this still causes a crash
class(Connection) :: self
end subroutine generic_desc
end interface
However, as you mentioned, swapping the order of "type First_Factory"
and "type, abstract :: Connection" did solve my problem. Great.
The empty 'contains' section was a typo. I've removed it. Thanks again !
-- Satish.BD
On Mon, Jun 21, 2010 at 10:19 PM, Tobias Burnus <burnus@net-b.de> wrote:
> On 06/21/2010 06:03 PM, bd satish wrote:
>> I am not sure whether this is a bug actually or I'm doing anything
>> wrong.
>
> Well, an internal compiler error (ICE) is always a bug...
>
>> abstract interface
>> subroutine generic_desc(self)
>> class(Connection) :: self
>> end subroutine generic_desc
>> end interface
>>
>
> You miss an "IMPORT" after the "SUBROUTINE ..." line - otherwise, the
> type "connection" is not visible in the interface.
> (In gfortran, it seems to be visible - thus, I have filled a bug report:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44614 )
>
> I think with the "import" change, the program is valid.
> Work around: Move the "type First_Factory" below the "type, abstract ::
> Connection". Cf. new bug report:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44616
>
> Side remark: Having an empty contains section for "type First_Factory"
> is invalid Fortran 2003, but valid Fortran 2008; thus, if you want to
> increase compatibility, remove the word "contains". (gfortran supports
> this F2008 feature, however.)
>
> Tobias
>
More information about the Fortran
mailing list