From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7301 invoked by alias); 8 Apr 2010 21:06:18 -0000 Received: (qmail 7262 invoked by uid 48); 8 Apr 2010 21:05:59 -0000 Date: Thu, 08 Apr 2010 21:06:00 -0000 Subject: [Bug fortran/43696] New: [OOP] Bogus error: Passed-object dummy argument must not be POINTER X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "janus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg00845.txt.bz2 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