* decl.c (variable_decl): Reject old style initialization
for derived type components.
* gfortran.dg/oldstyle_5.f: New test.
Co-Authored-By: Fritz Reese <Reese-Fritz@zai.com>
From-SVN: r212227
+2014-07-02 Jakub Jelinek <jakub@redhat.com>
+ Fritz Reese <Reese-Fritz@zai.com>
+
+ * decl.c (variable_decl): Reject old style initialization
+ for derived type components.
+
2014-06-29 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36275
if (!gfc_notify_std (GFC_STD_GNU, "Old-style "
"initialization at %C"))
return MATCH_ERROR;
+ else if (gfc_current_state () == COMP_DERIVED)
+ {
+ gfc_error ("Invalid old style initialization for derived type "
+ "component at %C");
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
return match_old_style_init (name);
}
+2014-07-02 Jakub Jelinek <jakub@redhat.com>
+ Fritz Reese <Reese-Fritz@zai.com>
+
+ * gfortran.dg/oldstyle_5.f: New test.
+
2014-07-02 Uros Bizjak <ubizjak@gmail.com>
* gfortran.dg/ieee/ieee_1.F90 (dg-additional-options): Remove -O0.
--- /dev/null
+C { dg-do compile }
+ TYPE T
+ INTEGER A(2)/1,2/ ! { dg-error "Invalid old style initialization for derived type component" }
+ END TYPE
+ TYPE S
+ INTEGER B/1/ ! { dg-error "Invalid old style initialization for derived type component" }
+ END TYPE
+ END