public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "abenson at caltech dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/52729] New: Symbol has no implicit type in SELECT TYPE block
Date: Mon, 26 Mar 2012 18:20:00 -0000	[thread overview]
Message-ID: <bug-52729-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             Bug #: 52729
           Summary: Symbol has no implicit type in SELECT TYPE block
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: abenson@caltech.edu


The following fails to compile with the latest gfortran 4.8 (r185768):

module testMod

  type testType
  end type testType

contains

  subroutine testSub()
    implicit none
    procedure(double precision ), pointer :: r
    class    (testType         ), pointer :: testObject
    double precision                      :: testVal

    select type (testObject)
    class is (testType)
       testVal=testFunc()
       r => testFunc
    end select
    return
  end subroutine testSub

  double precision function testFunc()
    implicit none
    return
  end function testFunc

end module testMod

$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/abenson/libexec/gcc/x86_64-unknown-linux-
gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7/configure --prefix=/home/abenson --enable-
languages=c,c++,fortran --disable-multilib --with-gmp=/home/abenson --with-
mpc=/home/abenson --with-mpfr=/home/abenson
Thread model: posix
gcc version 4.8.0 20120324 (experimental) (GCC) 

$ gfortran -c test.F90 -o test.o
test.F90:16.23:

       testVal=testFunc()
                       1
Error: Symbol 'testfunc' at (1) has no IMPLICIT type

Removing the "r => ...." line, removing the "select type", "class is" and "end 
select" lines or moving testFunc before testSub in the file all allow the code 
to compile successfully.


             reply	other threads:[~2012-03-26 18:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26 18:20 abenson at caltech dot edu [this message]
2012-04-02  9:54 ` [Bug fortran/52729] " burnus at gcc dot gnu.org
2012-04-11 13:09 ` burnus at gcc dot gnu.org
2012-04-11 13:10 ` 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-52729-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).