public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/62125] New: Nested select type not accepted (rejects valid)
@ 2014-08-13 13:37 mrestelli at gmail dot com
  2014-08-14  9:18 ` [Bug fortran/62125] " dominiq at lps dot ens.fr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mrestelli at gmail dot com @ 2014-08-13 13:37 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/62125] Nested select type not accepted (rejects valid)
  2014-08-13 13:37 [Bug fortran/62125] New: Nested select type not accepted (rejects valid) mrestelli at gmail dot com
@ 2014-08-14  9:18 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-08-14  9:18 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-08-14
                 CC|                            |burnus at gcc dot gnu.org
            Version|fortran-dev                 |5.0
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed from 4.5 up to trunk (5.0). However, while I don't see why the code
would be invalid, I am not 100% sure it is: at least "(As a reference, ifort
accepts this code.)" does not prove it, fort being known to be quite lax about
the standard.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/62125] Nested select type not accepted (rejects valid)
  2014-08-13 13:37 [Bug fortran/62125] New: Nested select type not accepted (rejects valid) mrestelli at gmail dot com
  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
  2 siblings, 0 replies; 4+ messages in thread
From: anlauf at gmx dot de @ 2014-08-22 22:03 UTC (permalink / raw)
  To: gcc-bugs

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

Harald Anlauf <anlauf at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gmx dot de

--- Comment #3 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to mrestelli from comment #2)
> I can not say 100% that the code is correct, but at least reading 8.6
> "The SELECT TYPE Construct" of "The Fortran 2003 Handbook" I don't see
> why it shouldn't.

FWIW, I have tried NAG, PGI, XLF and Cray.  All of them accept the code.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/62125] Nested select type not accepted (rejects valid)
  2014-08-13 13:37 [Bug fortran/62125] New: Nested select type not accepted (rejects valid) mrestelli at gmail dot com
  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
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-08-22 23:08 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> FWIW, I have tried NAG, PGI, XLF and Cray.  All of them accept the code.

So marked as NEW.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-22 23:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-13 13:37 [Bug fortran/62125] New: Nested select type not accepted (rejects valid) mrestelli at gmail dot com
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

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