public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43696]  New: [OOP] Bogus error: Passed-object dummy argument must not be POINTER
@ 2010-04-08 21:06 janus at gcc dot gnu dot org
  2010-04-08 21:11 ` [Bug fortran/43696] " janus at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: janus at gcc dot gnu dot org @ 2010-04-08 21:06 UTC (permalink / raw)
  To: gcc-bugs

Consider the following (supposedly valid) code:


MODULE error_stack_module
  implicit none

  type,abstract::serializable_class
   contains
     procedure(ser_DTV_RF),deferred::read_formatted
  end type serializable_class

  abstract interface
     subroutine ser_DTV_RF(dtv,unit,iotype,v_list,iostat,iomsg)
       import serializable_class
       CLASS(serializable_class),INTENT(INOUT) :: dtv
       INTEGER, INTENT(IN) :: unit
       CHARACTER (LEN=*), INTENT(IN) :: iotype
       INTEGER, INTENT(IN) :: v_list(:)
       INTEGER, INTENT(OUT) :: iostat
       CHARACTER (LEN=*), INTENT(INOUT) :: iomsg
     end subroutine ser_DTV_RF
  end interface

  type,extends(serializable_class)::error_type
     class(error_type),pointer::next=>null()
   contains
     procedure::read_formatted=>error_read_formatted
  end type error_type

contains

  recursive subroutine
error_read_formatted(dtv,unit,iotype,v_list,iostat,iomsg)
    CLASS(error_type),INTENT(INOUT) :: dtv
    INTEGER, INTENT(IN) :: unit
    CHARACTER (LEN=*), INTENT(IN) :: iotype
    INTEGER, INTENT(IN) :: v_list(:)
    INTEGER, INTENT(OUT) :: iostat
    CHARACTER (LEN=*), INTENT(INOUT) :: iomsg
    character(8),allocatable::type
    character(8),allocatable::next
    call basic_read_string(unit,type)
    call basic_read_string(unit,next)
    if(next=="NEXT")then
       allocate(dtv%next)
       call dtv%next%read_formatted(unit,iotype,v_list,iostat,iomsg)
    end if
  end subroutine error_read_formatted

 end MODULE error_stack_module


With current trunk, compilation results in:


error_stack.f03:25.14:

     procedure::read_formatted=>error_read_formatted
              1
Error: Passed-object dummy argument of 'error_read_formatted' at (1) must not
be POINTER
error_stack.f03:22.46:

  type,extends(serializable_class)::error_type
                                              1
Error: Derived-type 'error_type' declared at (1) must be ABSTRACT because
'read_formatted' is DEFERRED and not overridden
f951: internal compiler error: in resolve_class_esym, at fortran/resolve.c:5255


The first error message is apparently bogus, the second one seems to be a
consequence of the first one. The ICE may be a separate issue.


-- 
           Summary: [OOP] Bogus error: Passed-object dummy argument must not
                    be POINTER
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janus at gcc dot gnu dot org


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


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

end of thread, other threads:[~2010-05-05  8:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-08 21:06 [Bug fortran/43696] New: [OOP] Bogus error: Passed-object dummy argument must not be POINTER janus at gcc dot gnu dot org
2010-04-08 21:11 ` [Bug fortran/43696] " janus at gcc dot gnu dot org
2010-04-08 21:24 ` dominiq at lps dot ens dot fr
2010-04-09  8:42 ` burnus at gcc dot gnu dot org
2010-04-09 15:22 ` boschmann at tp1 dot physik dot uni-siegen dot de
2010-04-12  9:50 ` janus at gcc dot gnu dot org
2010-05-03 20:04 ` janus at gcc dot gnu dot org
2010-05-05  7:45 ` janus at gcc dot gnu dot org
2010-05-05  8:13 ` janus at gcc dot gnu dot 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).