re PR fortran/34915 (-std=f95 rejects len_trim() and index() in init expressions)

gcc/fortran:
2008-01-22  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/34915
	* expr.c (check_elemental): Fix check for valid data types.


gcc/testsuite:
	2008-01-22  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/34915
	* gfortran.dg/initialization_18.f90: New test.

From-SVN: r131715
This commit is contained in:
Daniel Franke 2008-01-22 07:19:54 -05:00 committed by Daniel Franke
parent 0387c1429d
commit c29164019f
4 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2008-01-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/34915
* expr.c (check_elemental): Fix check for valid data types.
2008-01-22 Tobias Burnus <burnus@net-b.de>
PR fortran/34899

View file

@ -2109,7 +2109,8 @@ check_elemental (gfc_expr *e)
|| !e->value.function.isym->elemental)
return MATCH_NO;
if ((e->ts.type != BT_INTEGER || e->ts.type != BT_CHARACTER)
if (e->ts.type != BT_INTEGER
&& e->ts.type != BT_CHARACTER
&& gfc_notify_std (GFC_STD_F2003, "Extension: Evaluation of "
"nonstandard initialization expression at %L",
&e->where) == FAILURE)

View file

@ -1,3 +1,8 @@
2008-01-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/34915
* gfortran.dg/initialization_18.f90: New test.
2008-01-22 Tobias Burnus <burnus@net-b.de>
PR fortran/34899

View file

@ -0,0 +1,10 @@
! { dg-do compile }
! { dg-options "-std=f95 -Wall" }
!
! PR fortran/34915
! Testcase contributed by Al Greynolds via comp.lang.fortran.
!
character(*),dimension(3),parameter :: a=(/'a() ','b(,) ','c(,,)'/)
integer,dimension(3),parameter :: l=len_trim(a)
end