public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mrestelli at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/62125] New: Nested select type not accepted (rejects valid)
Date: Wed, 13 Aug 2014 13:37:00 -0000	[thread overview]
Message-ID: <bug-62125-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62125

            Bug ID: 62125
           Summary: Nested select type not accepted (rejects valid)
           Product: gcc
           Version: fortran-dev
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mrestelli at gmail dot com

Hi, I see that gfortran does not compile the attached code, which
seems fine to me.


$ gfortran -c test.f90 -o test.o 
test.f90:31.21:

       write(*,*) u%x
                     1
Error: 'x' at (1) is not a member of the 't1' structure


$ gfortran --version           
GNU Fortran (GCC) 4.10.0 20140812 (experimental)
Copyright (C) 2014 Free Software Foundation, Inc.


(As a reference, ifort accepts this code.)


Here is the code:


module m
 implicit none

 type, abstract :: t1
  logical :: l
 end type t1

 type, extends(t1), abstract :: t2
  integer :: i
 end type t2

 type, extends(t2), abstract :: t3
  real :: x
 end type t3

contains

 subroutine s(u)
  class(t1), intent(in) :: u

   write(*,*) u%l

   select type(u)
    class is(t2)

     write(*,*) u%i

     select type(u)
      class is(t3)

       write(*,*) u%x

     end select

   end select

 end subroutine s

end module m


             reply	other threads:[~2014-08-13 13:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13 13:37 mrestelli at gmail dot com [this message]
2014-08-14  9:18 ` [Bug fortran/62125] " dominiq at lps dot ens.fr
2014-08-22 22:03 ` anlauf at gmx dot de
2014-08-22 23:08 ` dominiq at lps dot ens.fr

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-62125-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).