public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ian_harvey at bigpond dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/44265]  New: Link error with reference to parameter array in specification expression
Date: Tue, 25 May 2010 02:00:00 -0000	[thread overview]
Message-ID: <bug-44265-17837@http.gcc.gnu.org/bugzilla/> (raw)

The following program compiles successfully, but results in an undefined
reference to `___MOD_names' during linking.  It compiles and links successfully
with g95 0.92! (May 31, 2009)and ifort 11.1.065.

Using gfortran built from svn trunk revision 159797.  Command line was simply
"gfortran filename.f90".  Some experimentation shows that the problem is
related to the use of an module procedure scoped array parameter in the
specification expression for the function result.  The type of the parameter
array doesn't seem to matter.

MODULE Fruits
  IMPLICIT NONE    
  PRIVATE
  PUBLIC :: Get
CONTAINS
  FUNCTION Get(i) RESULT(s)    
    CHARACTER(*), PARAMETER :: names(3) = [  &
        'Apple  ',  &
        'Orange ',  &
        'Mango  ' ];              
    INTEGER, INTENT(IN) :: i
    CHARACTER(LEN_TRIM(names(i))) :: s    
    !****    
    s = names(i)    
  END FUNCTION Get
END MODULE Fruits

PROGRAM WheresThatbLinkingConstantGone
  USE Fruits  
  IMPLICIT NONE
  !****
  WRITE (*, "('Eat the tasty ',A)") Get(1)
END PROGRAM WheresThatbLinkingConstantGone


-- 
           Summary: Link error with reference to parameter array in
                    specification expression
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian_harvey at bigpond dot com
 GCC build triplet: i686-pc-mingw32
  GCC host triplet: i686-pc-mingw32
GCC target triplet: i686-pc-mingw32


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


             reply	other threads:[~2010-05-25  2:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25  2:00 ian_harvey at bigpond dot com [this message]
2010-05-25  9:50 ` [Bug fortran/44265] " burnus at gcc dot gnu dot 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-44265-17837@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).