re PR fortran/14771 (frontend doesn't record parentheses)

fortran/
	PR fortran/14771
	* arith.c (eval_intrinsic): Accept INTRINSIC_PARENTHESES.
	* expr.c (check_intrinsic_op): Likewise.
	* module.c (mio_expr): Likewise.
testsuite/
	PR fortran/14771
	* gfortran.dg/parens_4.f90: New.
	* gfortran.dg/parens_5.f90: New.

From-SVN: r110840
This commit is contained in:
Tobias Schlüter 2006-02-10 19:08:27 +01:00
parent ac1f3b7e6a
commit 083cc29303
7 changed files with 54 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2006-02-10 Tobias Schl<68>üter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/14771
* arith.c (eval_intrinsic): Accept INTRINSIC_PARENTHESES.
* expr.c (check_intrinsic_op): Likewise.
* module.c (mio_expr): Likewise.
2006-02-09 Tobias Schl<68>üter <tobias.schlueter@physik.uni-muenchen.de>
* dump-parse-tree.c: Update copyright years.

View File

@ -1507,6 +1507,12 @@ eval_intrinsic (gfc_intrinsic_op operator,
unary = 1;
break;
case INTRINSIC_PARENTHESES:
temp.ts = op1->ts;
unary = 1;
break;
case INTRINSIC_GE:
case INTRINSIC_LT: /* Additional restrictions */
case INTRINSIC_LE: /* for ordering relations. */

View File

@ -1344,6 +1344,9 @@ check_intrinsic_op (gfc_expr * e, try (*check_function) (gfc_expr *))
break;
case INTRINSIC_PARENTHESES:
break;
default:
gfc_error ("Only intrinsic operators can be used in expression at %L",
&e->where);

View File

@ -2514,6 +2514,7 @@ mio_expr (gfc_expr ** ep)
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
case INTRINSIC_NOT:
case INTRINSIC_PARENTHESES:
mio_expr (&e->value.op.op1);
break;

View File

@ -1,3 +1,9 @@
2006-02-10 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/14771
* gfortran.dg/parens_4.f90: New.
* gfortran.dg/parens_5.f90: New.
2006-02-10 Richard Guenther <rguenther@suse.de>
* testsuite/gcc.dg/pr23372-1.c: Remove empty file.

View File

@ -0,0 +1,12 @@
! { dg-do compile }
! Fallout from the patch for PR 14771
! Testcase by Erik Zeek
program test
call bob(5)
contains
subroutine bob(n)
integer, intent(in) :: n
character(len=n) :: temp1
character(len=(n)) :: temp2 ! Fails here
end subroutine bob
end program test

View File

@ -0,0 +1,19 @@
! { dg-do run }
! Another case of fallout from the original patch for PR14771
! Testcase by Erik Zeek
module para
contains
function bobo(n)
integer, intent(in) :: n
character(len=(n)) :: bobo ! Used to fail here
bobo = "1234567890"
end function bobo
end module para
program test
use para
implicit none
character*5 c
c = bobo(5)
if (c .ne. "12345") call abort
end program test