Cf. http://groups.google.com/group/comp.lang.fortran/msg/3ff093de4ed9e7c0

The following program is valid as F2003 has:

"12.3.2.1 Interface block
"A generic name may be the same as a derived-type name, in which case all of
the procedures in the interface block shall be functions."

Currently, it is rejected with:

Error: DERIVED attribute of 'foo' conflicts with PROCEDURE attribute at (1)


module foobar
  implicit none
  type foo
    integer :: bar
  end type

  interface foo
    module procedure constructor
  end interface

contains
  type(foo) function constructor()
     constructor%bar=1
  end function
end module


-- 
           Summary: F2003: GENERIC interface with generic name = derived-
                    type name
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          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=40824

Reply via email to