Commit 2f00fb3d by Steven G. Kargl

re PR fortran/88155 (ICE in gfc_format_decoder, at fortran/error.c:947)

2018-12-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88155
	* primary.c (gfc_match_structure_constructor):  Set the locus of
	an expression to avoid a NULL pointer dereference.

2018-12-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88155
	* gfortran.dg/pr70870_1.f90: Update testcase to use -std=gnu.
	* gfortran.dg/pr88155.f90: New test.

From-SVN: r267041
parent 85c223fa
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88155
* primary.c (gfc_match_structure_constructor): Set the locus of
an expression to avoid a NULL pointer dereference.
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88249
* gfortran.h: Update prototype for gfc_resolve_filepos().
* io.c (gfc_resolve_filepos): Check for UNIT number if ERR= is present.
......
......@@ -3212,6 +3212,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
e = gfc_get_expr ();
e->symtree = symtree;
e->expr_type = EXPR_FUNCTION;
e->where = gfc_current_locus;
gcc_assert (gfc_fl_struct (sym->attr.flavor)
&& symtree->n.sym->attr.flavor == FL_PROCEDURE);
......
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88155
* gfortran.dg/pr70870_1.f90: Update testcase to use -std=gnu.
* gfortran.dg/pr88155.f90: New test.
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88249
* gfortran.dg/pr88249.f90: New test.
......
! { dg-do compile }
! { dg-options "-std=gnu" }
! PR fortran/70870
! Contributed by Vittorio Zecca <zeccav at gmail dot com >
type t
......
! { dg-do compile }
program p
type t
integer :: a
end type
type(t) :: x
data x /t()1/ ! { dg-error "No initializer for component" }
print *, x
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