Commit 13a7688f by Thomas Koenig

re PR fortran/85083 (ICE in gfc_convert_to_structure_constructor, at fortran/primary.c:2915)

2018-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Harald Anlauf  <anlauf@gmx.de>

	PR fortran/85083
	* primary.c (gfc_convert_to_structure_constructor): Check
	conformance of argument types in structure constructor.

2018-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Harald Anlauf  <anlauf@gmx.de>

	* gfortran.dg/structure_constructor_15.f90: New test.


Co-Authored-By: Harald Anlauf <anlauf@gmx.de>

From-SVN: r258899
parent d555040f
2018-03-27 Thomas Koenig <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>
PR fortran/85083
* primary.c (gfc_convert_to_structure_constructor): Check
conformance of argument types in structure constructor.
2018-03-26 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66709
......
......@@ -2898,6 +2898,7 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c
if (this_comp->ts.type == BT_CHARACTER && !this_comp->attr.allocatable
&& this_comp->ts.u.cl && this_comp->ts.u.cl->length
&& this_comp->ts.u.cl->length->expr_type == EXPR_CONSTANT
&& actual->expr->ts.type == BT_CHARACTER
&& actual->expr->expr_type == EXPR_CONSTANT)
{
ptrdiff_t c, e;
......
2018-03-27 Thomas Koenig <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>
* gfortran.dg/structure_constructor_15.f90: New test.
2018-03-27 Volker Reichelt <v.reichelt@netcologne.de>
* g++.dg/cpp0x/defaulted2.C: Use dg-message instead of dg-error
......
! { dg-do compile }
! PR 85083
!
! Testcase from PR by G. Steinmetz <gscfq@t-online.de>
!
program p
type t
character(3) :: c
end type t
type(t), allocatable :: z
allocate (z, source=t(.true.,'abc')) ! { dg-error "Too many components" }
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