public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nagl46 at web dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/52111] New: [OOP] procedure pointer with polymorphic passed dummy argument
Date: Fri, 03 Feb 2012 16:21:00 -0000	[thread overview]
Message-ID: <bug-52111-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             Bug #: 52111
           Summary: [OOP] procedure pointer with polymorphic passed dummy
                    argument
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nagl46@web.de


I declare a procedure pointer in an abstract type
>> procedure(solve_gen), pointer :: solve

with procedure interface
>> abstract interface
>>   subroutine solve_gen(this, val)
>>     import :: solverAbstract_t
>>     class(solverAbstract_t), intent(inout) :: this
>>     integer, intent(inout) :: val
>>   end subroutine
>> end interface

Class solver_t is a subclass of solverAbstract_t.
Now I want solve to point to
>>  subroutine solveLeft_sub(this, val)
>>    class(solver_t), intent(inout) :: this
>>    integer, intent(inout) :: val
>>
>>    write(*,*) 'i solve left'
>>  end subroutine

Compiling my program with this classes fails with:
>>tatanka@tippi:~/tmp$ gfortran  main.f90
>>main.f90:66.22:
>>
>>        this%solve => solveLeft_sub
>>                      1
>>Error: Interface mismatch in procedure pointer assignment at (1): Type/rank >>mismatch in argument 'this'
>>main.f90:68.22:
>>
>>        this%solve => solveRight_sub
>>                      1
>>Error: Interface mismatch in procedure pointer assignment at (1): Type/rank >>mismatch in argument 'this'
>>main.f90:74.6:
>>
>>  use m_solver
>>      1
>>Fatal Error: Can't open module file 'm_solver.mod' for reading at (1): No such >>file or directory

I found this bug in:
>>GNU Fortran (GCC) 4.7.0 20120131 (experimental)
and in
>>GNU Fortran (GCC) 4.7.0 20120120 (experimental).

In
>>GNU Fortran (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
program works fine.
I also tested the bug on cray with
>>hpcatism@eslogin002:~> ftn --version
>>/opt/cray/xt-asyncpe/5.06/bin/ftn: INFO: Compiling with >>CRAYPE_COMPILE_TARGET=native.
>>/opt/cray/cce/8.0.1/cftn/x86-64/bin/ftn_driver.exe: invalid option -- '-'
On cray program also compiled fine and program works.


             reply	other threads:[~2012-02-03 16:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 16:21 nagl46 at web dot de [this message]
2012-02-03 16:22 ` [Bug fortran/52111] " nagl46 at web dot de
2012-02-03 17:32 ` burnus at gcc dot gnu.org
2012-02-03 17:52 ` nagl46 at web dot de
2012-02-04 11:03 ` nagl46 at web dot de
2012-02-05 16:43 ` burnus at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-52111-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).