Commit b18f1efc by Jakub Jelinek Committed by Jakub Jelinek

decl.c (variable_decl): Reject old style initialization for derived type components.

	* 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
parent 4a72ba02
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
......
......@@ -1997,6 +1997,13 @@ variable_decl (int elem)
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.
......
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
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