With std f95 or f2003, "reshape" is not allowed in real arrays, but it is in
integer ones or with std legacy or gnu.

It seems the standard should actually allow this construct (see
http://gcc.gnu.org/ml/fortran/2007-02/msg00001.html), so here is a bug report
(I didn't anything similar).


$cat test.f90
PROGRAM test
  IMPLICIT NONE

  INTEGER, DIMENSION(3,3), PARAMETER :: &
    Aij=RESHAPE((/ 1,3,3, &
                   3,2,2, &
                   3,2,2 /), (/3,3/))
  REAL, DIMENSION(3,3), PARAMETER :: &
    Bij=RESHAPE((/ 1.0D0,3.0D0,3.0D0, &
                   3.0D0,2.0D0,2.0D0, &
                   3.0D0,2.0D0,2.0D0 /), (/3,3/))

END PROGRAM test

$gfortran -std=f95 -c test.f90
test.f90:9.8:

    Bij=RESHAPE((/ 1.0D0,3.0D0,3.0D0, &
       1
Error: Extension: Evaluation of nonstandard initialization expression at (1)


-- 
           Summary: Error with RESHAPE on REAL initialization
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jellby at yahoo dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31265

Reply via email to