This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

new test - parameterized derived type


Hi,

I've following test case to test Parameterized derived types, which is
introduced with f2003 standard. Is the following test case valid?

$ cat derive_param.f90
program test
type der_type(real_kind,n,m)
     integer, kind :: real_kind
     integer, len  :: n,m
     real(real_kind) :: value(n,m)
end type
type(der_type(kind(0.0),10,20)) :: x
type(der_type(real_kind=kind(0d0),n=n1,m=n2)) :: y
end

With mainline gfortran, I get,
In file derive_param.f90:2

           type der_type(real_kind,n,m)
          1
Error: Unclassifiable statement at (1)
 In file derive_param.f90:3

              integer, kind :: real_kind
                    1
Error: Syntax error in data declaration at (1)
 In file derive_param.f90:4

              integer, len  :: n,m
                    1
Error: Syntax error in data declaration at (1)
 In file derive_param.f90:5

     real(real_kind) :: value(n,m)
         1
Error: Variable 'real_kind' at (1) cannot appear in an initialization
expression
 In file derive_param.f90:6

           end type
             1
Error: Expecting END PROGRAM statement at (1)
 In file derive_param.f90:7

     type(der_type(kind(0.0),10,20)) :: x
    1
Error: Unclassifiable statement at (1)
 In file derive_param.f90:8

     type(der_type(real_kind=kind(0d0),n=n1,m=n2)) :: y
    1
Error: Unclassifiable statement at (1)

Is this not yet supported in gfortran OR did I miss something (user
error)?

Thanks in advance.

- Uttam


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]