While playing with modifications of PR4581, I tried

  module m
    implicit none
    type t
      integer :: i
    end type t
    type(t), dimension(2), parameter :: a1  = (/ t(1), t(2) /)
    type(t), dimension(2), parameter :: d = cshift ( a1, 1 )
  end module m

and got

pr45081_red.f90:7.43:

    type(t), dimension(2), parameter :: d = cshift ( a1, 1 )
                                           1
Error: transformational intrinsic 'cshift' at (1) is not permitted in an
initialization expression

The F2003 standard says:

(5) A reference to a transformational standard intrinsic function other than
NULL, where each argument is an initialization expression,

and the F2008 version adds:

(6) a reference to a transformational standard intrinsic function other than
COMMAND ARGUMENT -COUNT, NULL, NUM IMAGES, THIS IMAGE, where each argument is a
constant expression,

This is fixed by the following patch:


--- ../_clean/gcc/fortran/expr.c        2010-09-09 21:06:18.000000000 +0200
+++ gcc/fortran/expr.c  2010-09-16 12:24:49.000000000 +0200
@@ -2329,7 +2329,7 @@ check_transformational (gfc_expr *e)
   };

   static const char * const trans_func_f2003[] =  {
-    "all", "any", "count", "dot_product", "matmul", "null", "pack",
+    "all", "any", "count", "cshift", "dot_product", "eoshift", "matmul",
"null", "pack",
     "product", "repeat", "reshape", "selected_char_kind", "selected_int_kind",
     "selected_real_kind", "spread", "sum", "transfer", "transpose",
     "trim", "unpack", NULL

but then I am back to PR45081!-(even with the Paul's patch).


-- 
           Summary: CSHIFT and EOSHIFT are not in the make-164314p7m1.log
                    list
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominiq at lps dot ens dot fr


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

Reply via email to