re PR fortran/21730 ([4.0 only] Character length incorrect.)
PR fortran/21730 * decl.c (do_parm): Adjust character initializer to character length of symbol before assigning. From-SVN: r102104
This commit is contained in:
parent
30702a9f84
commit
7e2eba4bf9
|
@ -1,3 +1,9 @@
|
|||
2005-07-16 David Edelsohn <edelsohn@gnu.org>
|
||||
|
||||
PR fortran/21730
|
||||
* decl.c (do_parm): Adjust character initializer to character length
|
||||
of symbol before assigning.
|
||||
|
||||
2005-07-14 Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
* trans-types.c (MAX_REAL_KINDS): Increase from 4 to 5.
|
||||
|
|
|
@ -3101,6 +3101,16 @@ do_parm (void)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
if (sym->ts.type == BT_CHARACTER
|
||||
&& sym->ts.cl != NULL
|
||||
&& sym->ts.cl->length != NULL
|
||||
&& sym->ts.cl->length->expr_type == EXPR_CONSTANT
|
||||
&& init->expr_type == EXPR_CONSTANT
|
||||
&& init->ts.type == BT_CHARACTER
|
||||
&& init->ts.kind == 1)
|
||||
gfc_set_constant_character_len (
|
||||
mpz_get_si (sym->ts.cl->length->value.integer), init);
|
||||
|
||||
sym->value = init;
|
||||
return MATCH_YES;
|
||||
|
||||
|
|
Loading…
Reference in New Issue