aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2014-07-02 11:43:08 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2014-07-02 11:43:08 +0200
commitb18f1efce09e8cab57d6141754db3456fab938f7 (patch)
treeaaa9b1da048884fee7e274384842fcc7433a0f25 /gcc/fortran/decl.c
parent4a72ba02f4b9c15ea53ffa1a51b37d7447e3082c (diff)
downloadgcc-b18f1efce09e8cab57d6141754db3456fab938f7.zip
gcc-b18f1efce09e8cab57d6141754db3456fab938f7.tar.gz
gcc-b18f1efce09e8cab57d6141754db3456fab938f7.tar.bz2
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
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 7f74281..25d92a4 100644
--- a/gcc/fortran/decl.c
+++ b/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);
}