aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/class.c')
-rw-r--r--gcc/fortran/class.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index bcbe631..3f23556 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -2674,6 +2674,7 @@ find_intrinsic_vtab (gfc_typespec *ts)
gfc_namespace *sub_ns;
gfc_namespace *contained;
gfc_expr *e;
+ size_t e_size;
gfc_get_symbol (name, ns, &vtype);
if (!gfc_add_flavor (&vtype->attr, FL_DERIVED, NULL,
@@ -2708,11 +2709,13 @@ find_intrinsic_vtab (gfc_typespec *ts)
e = gfc_get_expr ();
e->ts = *ts;
e->expr_type = EXPR_VARIABLE;
+ if (ts->type == BT_CHARACTER)
+ e_size = ts->kind;
+ else
+ gfc_element_size (e, &e_size);
c->initializer = gfc_get_int_expr (gfc_size_kind,
NULL,
- ts->type == BT_CHARACTER
- ? ts->kind
- : gfc_element_size (e));
+ e_size);
gfc_free_expr (e);
/* Add component _extends. */