This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/48145] New: Generic interfaces & derived types cannot share names


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48145

           Summary: Generic interfaces & derived types cannot share names
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: townsend@astro.wisc.edu


Created attachment 23677
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23677
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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]