[Bug fortran/31222] Rejected: implicitly-typed dummys used in initialization expressions
--- Comment #5 from pault at gcc dot gnu dot org 2007-04-07 21:21 --- Subject: Bug 31222 Author: pault Date: Sat Apr 7 21:20:49 2007 New Revision: 123643 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=123643 Log: 2007-04-07 Paul Thomas [EMAIL PROTECTED] PR fortran/31222 * check.c (numeric_check): If an expresson has not got a type, see if it is a symbol for which a default type applies. 2007-04-07 Paul Thomas [EMAIL PROTECTED] PR fortran/31222 * gfortran.dg/default_numeric_type_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/default_numeric_type_1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/check.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31222
[Bug fortran/31222] Rejected: implicitly-typed dummys used in initialization expressions
--- Comment #6 from pault at gcc dot gnu dot org 2007-04-07 21:32 --- Fixed on trumk Paul -- pault at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31222
[Bug fortran/31222] Rejected: implicitly-typed dummys used in initialization expressions
--- Comment #4 from pault at gcc dot gnu dot org 2007-04-05 22:00 --- I submitted a patch for this in: http://gcc.gnu.org/ml/fortran/2007-04/msg00016.html Paul -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31222
[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
[Bug fortran/31222] Rejected: implicitly-typed dummys used in initialization expressions
--- Comment #1 from fxcoudert at gcc dot gnu dot org 2007-03-16 15:05 --- *** Bug 31225 has been marked as a duplicate of this bug. *** -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added CC||fxcoudert at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31222
[Bug fortran/31222] Rejected: implicitly-typed dummys used in initialization expressions
--- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-03-16 15:06 --- Tobias, you beat me to it, I only got PR31225 :) Here is the analysis I posted in my bug-report: The following valid code is rejected by gfortran: (When the lines giving explicit type to mode and dis are uncommented, gfortran compiles it fine.) $ cat a.f90 subroutine mysub1(a,b,mode,dis) ! integer :: mode ! real :: dis dimension a(abs(mode)),b(int(dis)) print *, mod write (*,*) abs(mode), nint(dis) end subroutine program testprog call mysub1((/1.,2./),(/1.,2.,3./),-2, 3.2) end -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Known to fail||4.1.3 4.2.0 4.3.0 Last reconfirmed|-00-00 00:00:00 |2007-03-16 15:06:50 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31222