diff options
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 9 |
1 files changed, 9 insertions, 0 deletions
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. */ |