public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/61179] New: Can not compile "type is(double complex)"
@ 2014-05-13 16:28 mrestelli at gmail dot com
  2014-05-13 16:50 ` [Bug fortran/61179] " mrestelli at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mrestelli at gmail dot com @ 2014-05-13 16:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61179
           Summary: Can not compile "type is(double complex)"
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mrestelli at gmail dot com

Hi,
   I can not compile the following (legal, I think) code:

module m
 implicit none
contains

 subroutine test(x)
  class(*), intent(in) :: x  
   select type(x)
    type is(complex)
     write(*,*) "complex"
    type is(double complex)
     write(*,*) "double complex"
   end select
 end subroutine test

end module m


$ gfortran -c dc.f90 
dc.f90:13.12:

    type is(double complex)
            1
Error: Syntax error in TYPE IS specification at (1)


$ gfortran --version
GNU Fortran (GCC) 4.10.0 20140508 (experimental)


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

* [Bug fortran/61179] Can not compile "type is(double complex)"
  2014-05-13 16:28 [Bug fortran/61179] New: Can not compile "type is(double complex)" mrestelli at gmail dot com
@ 2014-05-13 16:50 ` mrestelli at gmail dot com
  2014-05-13 17:25 ` dominiq at lps dot ens.fr
  2014-12-06 15:05 ` dominiq at lps dot ens.fr
  2 siblings, 0 replies; 4+ messages in thread
From: mrestelli at gmail dot com @ 2014-05-13 16:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from mrestelli <mrestelli at gmail dot com> ---
I see now that "DOUBLE COMPLEX" is not specified by the standard,
which rather says "There is no keyword for double precision complex."

And in fact for a different code I see that gfortran indicates it as
GNU extension.

So, my example above is not required to work, and I think the error
message is probably OK. (Although one could maybe consider allowing it
as part of the GNU extension...)

Regards,
   Marco


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

* [Bug fortran/61179] Can not compile "type is(double complex)"
  2014-05-13 16:28 [Bug fortran/61179] New: Can not compile "type is(double complex)" mrestelli at gmail dot com
  2014-05-13 16:50 ` [Bug fortran/61179] " mrestelli at gmail dot com
@ 2014-05-13 17:25 ` dominiq at lps dot ens.fr
  2014-12-06 15:05 ` dominiq at lps dot ens.fr
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-05-13 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-05-13
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
module m
 implicit none
contains

 subroutine test(x)
  integer, parameter :: dp=kind(0.0d0)
  class(*), intent(in) :: x
   select type(x)
    type is(complex)
     write(*,*) "complex"
     print *, x
!    type is(double complex)
    type is(complex(dp))
     write(*,*) "double complex"
     print *, x
   end select
 end subroutine test

end module m

use m
complex :: y=(1.0,2.0)
complex(8) :: z=(2.0,3.0)

call test(y)
call test(z)

end

compiles and gives at run time

 complex
 (  1.00000000    ,  2.00000000    )
 double complex
 (  2.0000000000000000     ,  3.0000000000000000     )

> So, my example above is not required to work, and I think the error
> message is probably OK. (Although one could maybe consider allowing it
> as part of the GNU extension...)

IMO the GNU extensions should be restricted to the compatibility with g77.
I am in favor to close this PR as WONTFIX.


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

* [Bug fortran/61179] Can not compile "type is(double complex)"
  2014-05-13 16:28 [Bug fortran/61179] New: Can not compile "type is(double complex)" mrestelli at gmail dot com
  2014-05-13 16:50 ` [Bug fortran/61179] " mrestelli at gmail dot com
  2014-05-13 17:25 ` dominiq at lps dot ens.fr
@ 2014-12-06 15:05 ` dominiq at lps dot ens.fr
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-12-06 15:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
No feedback for more than six months, closing as WONTFIX.


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

end of thread, other threads:[~2014-12-06 15:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-13 16:28 [Bug fortran/61179] New: Can not compile "type is(double complex)" mrestelli at gmail dot com
2014-05-13 16:50 ` [Bug fortran/61179] " mrestelli at gmail dot com
2014-05-13 17:25 ` dominiq at lps dot ens.fr
2014-12-06 15:05 ` 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).