aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/fortran/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/fortran/decl.c')
-rw-r--r--gcc-4.9/gcc/fortran/decl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/fortran/decl.c b/gcc-4.9/gcc/fortran/decl.c
index 4048ac913..eebecd59f 100644
--- a/gcc-4.9/gcc/fortran/decl.c
+++ b/gcc-4.9/gcc/fortran/decl.c
@@ -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);
}