Based on a report by bd satish at
http://gcc.gnu.org/ml/fortran/2010-06/msg00210.html

The following program is invalid as IMPORT is missing, but gfortran still
compiles it:

Expected: An error such as:
  Error: line 12: SELF is of undefined derived type CONNECTION
or
  error #6457: This derived type name has not been declared.   [CONNECTION]


module factory_pattern
implicit none

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

abstract interface
    subroutine generic_desc(self)
!        import
        class(Connection) :: self
    end subroutine generic_desc
end interface
end module factory_pattern


-- 
           Summary: [OOP] Wrongly importing a symbol into an interface
                    without IMPORT
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          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=44614

Reply via email to