PR 31972/fortran

PR 31972/fortran
* target-memory.c (gfc_target_expr_size): Add handling
for size of BT_HOLLERITH variables.
* check.c (gfc_check_transfer): Reject BT_HOLLERITH
variables in MOLD argument of TRANSFER.

From-SVN: r125141
This commit is contained in:
Brooks Moses 2007-05-28 20:53:09 +00:00 committed by Brooks Moses
parent 3613c7abfa
commit 3b45d6c489
3 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2007-05-28 Brooks Moses <brooks.moses@codesourcery.com>
PR 31972/fortran
* target-memory.c (gfc_target_expr_size): Add handling
for size of BT_HOLLERITH variables.
* check.c (gfc_check_transfer): Reject BT_HOLLERITH
variables in MOLD argument of TRANSFER.
2007-05-28 Brooks Moses <brooks.moses@codesourcery.com>
* gfortran.h (gfc_expr): Remove from_H, add "representation"

View File

@ -2601,6 +2601,13 @@ try
gfc_check_transfer (gfc_expr *source ATTRIBUTE_UNUSED,
gfc_expr *mold ATTRIBUTE_UNUSED, gfc_expr *size)
{
if (mold->ts.type == BT_HOLLERITH)
{
gfc_error ("'MOLD' argument of 'TRANSFER' intrinsic at %L must not be %s",
&mold->where, gfc_basic_typename (BT_HOLLERITH));
return FAILURE;
}
if (size != NULL)
{
if (type_check (size, 2, BT_INTEGER) == FAILURE)

View File

@ -102,6 +102,8 @@ gfc_target_expr_size (gfc_expr *e)
return size_logical (e->ts.kind);
case BT_CHARACTER:
return size_character (e->value.character.length);
case BT_HOLLERITH:
return e->representation.length;
case BT_DERIVED:
type = gfc_typenode_for_spec (&e->ts);
return int_size_in_bytes (type);