aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/intrinsic.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/intrinsic.c')
-rw-r--r--gcc/fortran/intrinsic.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 8c18706..0e0e6fe 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -5030,6 +5030,13 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag)
if (expr->ts.type == BT_UNKNOWN)
goto bad;
+ /* In building an array constructor, gfortran can end up here when no
+ conversion is required for an intrinsic type. We need to let derived
+ types drop through. */
+ if (from_ts.type != BT_DERIVED
+ && (from_ts.type == ts->type && from_ts.kind == ts->kind))
+ return true;
+
if (expr->ts.type == BT_DERIVED && ts->type == BT_DERIVED
&& gfc_compare_types (&expr->ts, ts))
return true;