We should only allow a) elemental functions b) we currently check gfc_init_expr_extensions(): /* FIXME: This should be moved into the intrinsic definitions. */ static const char * const init_expr_extensions[] = { "digits", "epsilon", "huge", "kind", "maxexponent", "minexponent", "precision", "present", "radix", "range", "selected_real_kind", "tiny", NULL }; I'm neither sure whether this is correct nor whether this is complete.
See: "7.1.7 Initialization expression" in Fortran 2003 and "7.1.6.1 Constant expression" in Fortran 95. There is at least the following difference between the standards: F2003: [Allowed is] "A reference to an elemental standard intrinsic function, where each argument is an initialization expression" F95: "An initialization expression is a constant expression in which the exponentiation operation is permitted only with an integer power, and each primary is [...] (4) An elemental intrinsic function reference of type integer or character where each argument is an initialization expression of type integer or character" -- Summary: Initialization expressions checking in gfc_intrinsic_func_interface Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962