Bug 40824 - F2003: GENERIC interface with generic name = derived-type name
Summary: F2003: GENERIC interface with generic name = derived-type name
Status: RESOLVED DUPLICATE of bug 39427
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2009-07-22 12:34 UTC by Tobias Burnus
Modified: 2010-12-28 21:49 UTC (History)
2 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2009-12-19 17:58:38


Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2009-07-22 12:34:29 UTC
Cf. http://groups.google.com/group/comp.lang.fortran/msg/3ff093de4ed9e7c0

The following program is valid as F2003 has:

" 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

  type(foo) function constructor()
  end function
end module
Comment 1 Paul Thomas 2009-12-19 17:58:38 UTC
This is going to be big trouble to fix.

I do not know how we can easily distinguish between two symbols with the same name and different flavours.

Maybe derived types should not be in the symtree but in one of their own?


Comment 2 Daniel Franke 2010-12-28 21:49:39 UTC
Same as the other.

*** This bug has been marked as a duplicate of bug 39427 ***