public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51713] New: Type mismatch for polymorphic dummy arguments depending on "use" path
@ 2011-12-30 15:07 bugs at stellardeath dot org
  2013-01-04 12:14 ` [Bug fortran/51713] " mikael at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: bugs at stellardeath dot org @ 2011-12-30 15:07 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51713
           Summary: Type mismatch for polymorphic dummy arguments
                    depending on "use" path
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bugs@stellardeath.org


Created attachment 26204
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26204
Test case, only compiles when changed according to the comments within

I get a compile-time type-mismatch error for a subroutine usage depending on
how I import the module containing the derived type declaration.

The subroutine is declared to return a class(mytype_t) pointer, it does so by
associating a pointer to a type(mytype_specific_t), an extension of
type(mytype_t).

The definition of type(mytype_specific_t) is in another module, if I now "use"
this module from within the subroutine itself, I get the following error:


$> gfortran -g3 -fcheck=all -pedantic typetest.f90 -o typetest
typetest.f90:42.18:

  call get_mytype(mytype)
                  1
Error: Actual argument to 'mytype' at (1) must have the same declared type


However, If I put the "use" statement in the module enclosing thus subroutine,
it compiles. I think this is an error, as the definition of
type(mytype_specific_t) should not be necessary outside of the subroutine.

As a source file says more than thousand words, see the attached file on which
I get the error.

Regards,
    Lorenz


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/51713] Type mismatch for polymorphic dummy arguments depending on "use" path
  2011-12-30 15:07 [Bug fortran/51713] New: Type mismatch for polymorphic dummy arguments depending on "use" path bugs at stellardeath dot org
@ 2013-01-04 12:14 ` mikael at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-01-04 12:14 UTC (permalink / raw)
  To: gcc-bugs


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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |mikael at gcc dot gnu.org
      Known to work|                            |4.6.3, 4.7.2, 4.8.0
         Resolution|                            |WORKSFORME

--- Comment #1 from Mikael Morin <mikael at gcc dot gnu.org> 2013-01-04 12:14:00 UTC ---
This seems to be accepted now.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-04 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-30 15:07 [Bug fortran/51713] New: Type mismatch for polymorphic dummy arguments depending on "use" path bugs at stellardeath dot org
2013-01-04 12:14 ` [Bug fortran/51713] " mikael at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).