Commit a74897c1 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/29962 (Initialization expressions)

fortran/
2006-12-04  Tobias Burnus  <burnus@net-b.de>

	PR fortran/29962
	* expr.c (check_intrinsic_op): Allow noninteger exponents for F2003.
   
     
testsuite/
2006-12-04  Tobias Burnus  <burnus@net-b.de>

	PR fortran/29962
	* initialization_4.f90: Test noninteger exponents (-std=f95).
	* initialization_5.f90: New test for noninteger exponents with -std=f2003

From-SVN: r119505
parent dd5ecf41
2006-12-04 Tobias Burnus <burnus@net-b.de>
PR fortran/29962
* expr.c (check_intrinsic_op): Allow noninteger exponents for F2003.
2006-12-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29821
......
......@@ -1622,9 +1622,11 @@ check_intrinsic_op (gfc_expr * e, try (*check_function) (gfc_expr *))
if (e->value.op.operator == INTRINSIC_POWER
&& check_function == check_init_expr && et0 (op2) != BT_INTEGER)
{
gfc_error ("Exponent at %L must be INTEGER for an initialization "
"expression", &op2->where);
return FAILURE;
if (gfc_notify_std (GFC_STD_F2003,"Fortran 2003: Noninteger "
"exponent in an initialization "
"expression at %L", &op2->where)
== FAILURE)
return FAILURE;
}
break;
......
2006-12-04 Tobias Burnus <burnus@net-b.de>
PR fortran/29962
* initialization_4.f90: Test noninteger exponents (-std=f95).
* initialization_5.f90: New test for noninteger exponents
with -std=f2003.
2006-12-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29821
......@@ -3,4 +3,5 @@
! { dg-do compile }
! { dg-options "-std=f95" }
real, parameter :: pi = 4.0*Atan(1.0) ! { dg-error "Evaluation of nonstandard initialization expression" }
real, parameter :: three = 27.0**(1.0/3.0) ! { dg-error "Noninteger exponent in an initialization expression" }
end
! initialization expression, now allowed in Fortran 2003
! PR fortran/29962
! { dg-do run }
! { dg-options "-std=f2003 -fall-intrinsics" }
real, parameter :: three = 27.0**(1.0/3.0)
if(abs(three-3.0)>epsilon(three)) call abort()
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment