This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/31222] Rejected: implicitly-typed dummys used in initialization expressions



------- Comment #3 from pault at gcc dot gnu dot org  2007-03-30 00:34 -------
This fixes it and regtests OK

Paul

Index: gcc/fortran/check.c
===================================================================
*** gcc/fortran/check.c (revision 123183)
--- gcc/fortran/check.c (working copy)
*************** numeric_check (gfc_expr *e, int n)
*** 58,63 ****
--- 58,75 ----
    if (gfc_numeric_ts (&e->ts))
      return SUCCESS;

+   /* If the expression has not got a type, check if its namespace can
+      offer a default type.  */
+   if ((e->expr_type == EXPR_VARIABLE || e->expr_type == EXPR_VARIABLE)
+         && e->symtree->n.sym->ts.type == BT_UNKNOWN
+         && gfc_set_default_type (e->symtree->n.sym, 0,
+                                  e->symtree->n.sym->ns) == SUCCESS
+         && gfc_numeric_ts (&e->symtree->n.sym->ts))
+     {
+       e->ts = e->symtree->n.sym->ts;
+       return SUCCESS;
+     }
+
    gfc_error ("'%s' argument of '%s' intrinsic at %L must be a numeric type",
             gfc_current_intrinsic_arg[n], gfc_current_intrinsic, &e->where);


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-03-16 15:06:50         |2007-03-30 00:34:40
               date|                            |


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


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