diff options
Diffstat (limited to 'gcc/fortran/decl.cc')
-rw-r--r-- | gcc/fortran/decl.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc index a7576f4..b8308ae 100644 --- a/gcc/fortran/decl.cc +++ b/gcc/fortran/decl.cc @@ -1713,7 +1713,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym) /* Function called by variable_decl() that adds a name to the symbol table. */ static bool -build_sym (const char *name, gfc_charlen *cl, bool cl_deferred, +build_sym (const char *name, int elem, gfc_charlen *cl, bool cl_deferred, gfc_array_spec **as, locus *var_locus) { symbol_attribute attr; @@ -1778,7 +1778,10 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred, if (sym->ts.type == BT_CHARACTER) { - sym->ts.u.cl = cl; + if (elem > 1) + sym->ts.u.cl = gfc_new_charlen (sym->ns, cl); + else + sym->ts.u.cl = cl; sym->ts.deferred = cl_deferred; } @@ -2960,7 +2963,7 @@ variable_decl (int elem) create a symbol for those yet. If we fail to create the symbol, bail out. */ if (!gfc_comp_struct (gfc_current_state ()) - && !build_sym (name, cl, cl_deferred, &as, &var_locus)) + && !build_sym (name, elem, cl, cl_deferred, &as, &var_locus)) { m = MATCH_ERROR; goto cleanup; @@ -10938,7 +10941,7 @@ enumerator_decl (void) /* OK, we've successfully matched the declaration. Now put the symbol in the current namespace. If we fail to create the symbol, bail out. */ - if (!build_sym (name, NULL, false, &as, &var_locus)) + if (!build_sym (name, 1, NULL, false, &as, &var_locus)) { m = MATCH_ERROR; goto cleanup; |