------- Comment #3 from burnus at gcc dot gnu dot org  2006-11-23 23:51 -------
Non-elemental intrinsic functions in Section 13.7 of Fortran 2003:

ALL(T), ALLOCATED(I), ANY(T), ASSOCIATED(I), BIT_SIZE(I),
COMMAND_ARGUMENT_COUNT(I), COUNT(T), CSHIFT(T), DIGITS(I), DOT_PRODUCT(T),
EOSHIFT(T), EPSILON(I), EXTENDS_TYPE_OF(I), HUGE(I), KIND(I), LBOUND(I),
LEN(I), MATMUL(T), MAXLOC(T), MAXVAL(T), MINLOC(T), MINVAL(T), NEW_LINE(I),
NULL(T), PACK(T), PRECISION(I), PRESENT(I),  PRODUCT(T), RADIX(I), RANGE(I),
REPEAT(T), RESHAPE(T), SAME_TYPE_AS(I), SELECTED_CHAR_KIND(T),
SELECTED_INT_KIND(T), SELECTED_REAL_KIND(T), SHAPE(I), SIZE(I), SPREAD(T),
SUM(T),  TINY(I), TRANSFER(T), TRANPOSE(T), TRIM(T), UBOUND(I), UNPACK(T), 

(I) = Inquiry functiony
(T) = Transformational function

Allowed in Fortran 2003:
- elemental standard intrinsic functions (with argument = initialization
expression)
- transformational standard intrinsic functions (constrain: dito), not NULL()
- NULL() without non-initialization expression type parameters
- Inquiry function where argument is either an initialization expression - or
when not needed - properties are not deferred/assumed or noninit. expr.
>From modules:
- IEEE_SELECTED_REAL_KIND

(Remark: This seems to allow command_line_argument(), but this is technically
not possible! -- well, if it is not supported, "0" can be returned)


Fortran 95:

- elemental functions: Only with initi.expr. of integer/character type
- Transformational functions: Only REPEAT, RESHAPE, SELECTED_INT_KIND,
SELECTED_REAL_KIND, TRANSFER, TRIM: w/ init.expr.-
- NULL
- Array inquiry function but not ALLOCATED [i.e.:  lbound, ubound, shape, size,
]
- BIT_SIZE, LEN, KIND
- Numeric inquiry function: digits, epsilon,huge,maxexponent, minexponent,
precision, radix,range,tiny

I don't think GFC_STD_GNU allows more than Fortran 2003 (and extra intrinsics
of -std=gnu are filtered out earlier).

Current problems:
---------------------------
 real :: p
 real, parameter :: x = TRANSFER('a',p)
end
Error:
Parameter 'p' at (1) has not been declared or is a variable, which does not
reduce to a constant expression
Works with g95, fails with ifort, f95, sunf95.
I believe this is valid in Fortran 95 (and Fortran 2003)
---------------------------
 real, parameter :: x = dot_product( (/1/), (/2/))
                      1
Error: transformational intrinsic 'dot_product' at (1) is not permitted in an
initialization expression
- Should be valid in Fortran 2003
- fails also in g95, f95, ifort
Presumably analogously: matmul, ...
---------------------------


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-11-23 23:51:55
               date|                            |


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

Reply via email to