===================================================================
@@ -3212,6 +3212,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_
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);
===================================================================
@@ -1,4 +1,5 @@
! { dg-do compile }
+! { dg-options "-std=gnu" }
! PR fortran/70870
! Contributed by Vittorio Zecca <zeccav at gmail dot com >
type t
===================================================================
@@ -0,0 +1,9 @@
+! { 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