Bug 48145 - Generic interfaces & derived types cannot share names
Summary: Generic interfaces & derived types cannot share names
Status: RESOLVED DUPLICATE of bug 39427
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-16 02:53 UTC by Rich Townsend
Modified: 2011-03-16 11:23 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Test case demonstrating issue (164 bytes, application/octet-stream)
2011-03-16 02:53 UTC, Rich Townsend
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rich Townsend 2011-03-16 02:53:27 UTC
Created attachment 23677 [details]
Test case demonstrating issue

There seems to be a problem when a generic interface and a derived type share the same name. Compiling the attached code with 4.6.0 (20110312) on OS X 10.6.6, I get the following error:

test_name_conflict.f90:7.18:

  interface mytype
                  1
Error: DERIVED attribute of 'mytype' conflicts with PROCEDURE attribute at (1)
test_name_conflict.f90:8.22:

     module procedure new_mytype
                      1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
test_name_conflict.f90:9.5:

  end interface
     1
Error: Expecting END MODULE statement at (1)

This conflict is bogus, since the F2003 standard allows derived types to share names with generic interfaces (see, e.g., Appendix C.1.6 of the standard).
Comment 1 janus 2011-03-16 11:23:17 UTC
We already have a bug report for this issue.

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