From c8e20bd09307de2a787351a88c93458b32d45363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Schl=C3=BCter?= Date: Sat, 15 May 2004 22:29:06 +0200 Subject: re PR fortran/13742 (Not Implemented: initial values for COMMON or EQUIVALENCE) PR fortran/13742 * decl.c (add_init_expr_to_sym): Verify that COMMON variable is not initialized in a disallowed fashion. * match.c (gfc_match_common): Likewise. (var_element): Verify that variable is not in the blank COMMON, if it is in a common. From-SVN: r81899 --- gcc/fortran/decl.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/fortran/decl.c') diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index c36c7ba..ff87bee 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -276,6 +276,15 @@ add_init_expr_to_sym (const char *name, gfc_expr ** initp, return FAILURE; } + if (attr.in_common + && !attr.data + && *initp != NULL) + { + gfc_error ("Initializer not allowed for COMMON variable '%s' at %C", + sym->name); + return FAILURE; + } + if (init == NULL) { /* An initializer is required for PARAMETER declarations. */ -- cgit v1.1