public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57145] New: [OOP] Faulty "Actual argument must be polymorphic" error
@ 2013-05-02 15:10 loximann at gmail dot com
  2013-05-02 15:50 ` [Bug fortran/57145] " dominiq at lps dot ens.fr
  0 siblings, 1 reply; 2+ messages in thread
From: loximann at gmail dot com @ 2013-05-02 15:10 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57145
           Summary: [OOP] Faulty "Actual argument must be polymorphic"
                    error
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: loximann@gmail.com


The following program will not compile with the following error:

move_alloc.F90:16.20:

    print*, my_func(static)
                    1
Error: Actual argument to 'input' at (1) must be polymorphic

However, if the declaration of type 'big' is removed altogether (comment lines
6-8), the program compiles without a problem.

######################################################
module my_module
    type :: small
        real :: a
    end type

    type :: big
        class(small), pointer :: v(:)
    end type
end module

program my_program
    use my_module
    implicit none
    type(small) :: static(1)=[small(5.5)]

    print*, my_func(static)

contains
    function my_func(input)
        class(small) :: input(:)
        real :: my_func
        my_func=input(1)%a
    end function
end program


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

* [Bug fortran/57145] [OOP] Faulty "Actual argument must be polymorphic" error
  2013-05-02 15:10 [Bug fortran/57145] New: [OOP] Faulty "Actual argument must be polymorphic" error loximann at gmail dot com
@ 2013-05-02 15:50 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 2+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-05-02 15:50 UTC (permalink / raw)
  To: gcc-bugs


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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |burnus at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-05-02 15:50:18 UTC ---
This has been fixed between revisions 189610 (2012-07-18) which gives the error
and 189780 (2012-07-23). This may have been fixed by revision 189669 and/or
189678.

The test compiles with the latest 4.8.0 release, so you may consider to
upgrade.


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

end of thread, other threads:[~2013-05-02 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-02 15:10 [Bug fortran/57145] New: [OOP] Faulty "Actual argument must be polymorphic" error loximann at gmail dot com
2013-05-02 15:50 ` [Bug fortran/57145] " dominiq at lps dot ens.fr

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).