Commit 083cc293 by Tobias Schlüter

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
parent ac1f3b7e
2006-02-10 Tobias Schlter <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 Schlter <tobias.schlueter@physik.uni-muenchen.de> 2006-02-09 Tobias Schlter <tobias.schlueter@physik.uni-muenchen.de>
* dump-parse-tree.c: Update copyright years. * dump-parse-tree.c: Update copyright years.
......
...@@ -1507,6 +1507,12 @@ eval_intrinsic (gfc_intrinsic_op operator, ...@@ -1507,6 +1507,12 @@ eval_intrinsic (gfc_intrinsic_op operator,
unary = 1; unary = 1;
break; break;
case INTRINSIC_PARENTHESES:
temp.ts = op1->ts;
unary = 1;
break;
case INTRINSIC_GE: case INTRINSIC_GE:
case INTRINSIC_LT: /* Additional restrictions */ case INTRINSIC_LT: /* Additional restrictions */
case INTRINSIC_LE: /* for ordering relations. */ case INTRINSIC_LE: /* for ordering relations. */
......
...@@ -1344,6 +1344,9 @@ check_intrinsic_op (gfc_expr * e, try (*check_function) (gfc_expr *)) ...@@ -1344,6 +1344,9 @@ check_intrinsic_op (gfc_expr * e, try (*check_function) (gfc_expr *))
break; break;
case INTRINSIC_PARENTHESES:
break;
default: default:
gfc_error ("Only intrinsic operators can be used in expression at %L", gfc_error ("Only intrinsic operators can be used in expression at %L",
&e->where); &e->where);
......
...@@ -2514,6 +2514,7 @@ mio_expr (gfc_expr ** ep) ...@@ -2514,6 +2514,7 @@ mio_expr (gfc_expr ** ep)
case INTRINSIC_UPLUS: case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS: case INTRINSIC_UMINUS:
case INTRINSIC_NOT: case INTRINSIC_NOT:
case INTRINSIC_PARENTHESES:
mio_expr (&e->value.op.op1); mio_expr (&e->value.op.op1);
break; break;
......
2006-02-10 Tobias Schlter <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> 2006-02-10 Richard Guenther <rguenther@suse.de>
* testsuite/gcc.dg/pr23372-1.c: Remove empty file. * testsuite/gcc.dg/pr23372-1.c: Remove empty file.
! { 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
! { 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
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