From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1616 invoked by alias); 24 Jul 2013 10:40:27 -0000 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 Received: (qmail 1553 invoked by uid 48); 24 Jul 2013 10:40:23 -0000 From: "stefan.mauerberger at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/57966] New: Using a TBP to specify the shape of a dummy argument Date: Wed, 24 Jul 2013 10:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stefan.mauerberger at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg01111.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57966 Bug ID: 57966 Summary: Using a TBP to specify the shape of a dummy argument Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: stefan.mauerberger at gmail dot com Created attachment 30542 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30542&action=edit minimal example Hi There! I am faced with some weired behavior. Because it is a little hard to describe I am providing an example: There is a DDT 'config_cls' whose pure TBP 'my_size' does nothing but returning 10 . > TYPE config_cls > CONTAINS > PROCEDURE, NOPASS :: my_size > END TYPE > PURE INTEGER FUNCTION my_size() > my_size = 10 > END FUNCTION my_size In addition there is a subroutine 'my_sub' which expects a dummy argument of explicit shape 'config%my_size()'. > SUBROUTINE my_sub( field ) > REAL, INTENT(INOUT) :: field( config%my_size() ) > !REAL, INTENT(INOUT), CONTIGUOUS :: field(:) ! Assumed shape works > !REAL, INTENT(INOUT) :: field( my_size() ) ! works, too > END SUBROUTINE my_sub As far as I can see this is valid Fortran code. However, gfortran complains that config%my_size() is not a function. Well, this is wrong (for non dummy arguments it works perfectly fine)! Attached, there is a minimal example. Compiling it with gfortran terminates with: > test.f90:33.22: > > REAL :: field( config%my_size() ) > 1 > Error: 'my_size' at (1) should be a FUNCTION Any ideas? Cheers, Stefan Actually, ifort 12.1.6, nag 5.3.2 and pgfortran 13.4 are just fine.