public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* A gfortran bug on parameterized derived types
@ 2020-05-23 14:43 Adelson Oliveira
  2020-05-23 16:30 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Adelson Oliveira @ 2020-05-23 14:43 UTC (permalink / raw)
  To: gcc-help

Hi,

I guess this is a bug to be reported.
Essentially, if I change position of the declaration of the variable n, the
error shows up.
The following code (file is teste.f90):

MODULE TESTET
 IMPLICIT NONE
 INTEGER :: n
 TYPE :: Test(n)
   INTEGER, KIND :: n = 4
   REAL(n) :: v
 END TYPE Test
 PUBLIC Test
END MODULE TESTET

returns an error if:
$ gfortran -c teste.f90
teste.f90:6:8:

    REAL(n) :: v
        1
Error: Parameter ‘n’ at (1) has not been declared or is a variable, which
does not reduce to a constant expression

The error is not issued if I move the declaration of variable n to after
TYPE test specification:

MODULE TESTET
 IMPLICIT NONE
 TYPE :: Test(n)
   INTEGER, KIND :: n = 4
   REAL(n) :: v
 END TYPE Test
 INTEGER :: n
 PUBLIC Test
END MODULE TESTET

Thanks & Regards

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

* Re: A gfortran bug on parameterized derived types
  2020-05-23 14:43 A gfortran bug on parameterized derived types Adelson Oliveira
@ 2020-05-23 16:30 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2020-05-23 16:30 UTC (permalink / raw)
  To: Adelson Oliveira; +Cc: gcc-help

On Sat, 23 May 2020 at 15:48, Adelson Oliveira via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hi,
>
> I guess this is a bug to be reported.

Then it should be in bugzilla, not here. Please see https://gcc.gnu.org/bugs/

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

end of thread, other threads:[~2020-05-23 16:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-23 14:43 A gfortran bug on parameterized derived types Adelson Oliveira
2020-05-23 16:30 ` Jonathan Wakely

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