+2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/51434
+ * simplify.c (gfc_simplify_transfer): Resolve mold.
+
2018-03-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/80965
#include "gfortran.h"
#include "arith.h"
#include "intrinsic.h"
+#include "match.h"
#include "target-memory.h"
#include "constructor.h"
#include "version.h" /* For version_string. */
unsigned char *buffer;
size_t result_length;
+ if (!gfc_is_constant_expr (source) || !gfc_is_constant_expr (size))
+ return NULL;
- if (!gfc_is_constant_expr (source)
- || (gfc_init_expr_flag && !gfc_is_constant_expr (mold))
- || !gfc_is_constant_expr (size))
+ if (!gfc_resolve_expr (mold))
+ return NULL;
+ if (gfc_init_expr_flag && !gfc_is_constant_expr (mold))
return NULL;
if (!gfc_calculate_transfer_sizes (source, mold, size, &source_size,
+2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/51434
+ * gfortran.dg/pr51434.f90: New test.
+
2018-03-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/61358
--- /dev/null
+! { dg-do run }
+! PR fortran/51434
+module foo
+ implicit none
+ integer, parameter :: n = 5
+ character(len=1), parameter :: s(n) = 'a'
+ type :: a
+ integer :: m = n
+ character(len=1):: t(n) = transfer('abcde ', s)
+ end type a
+end module foo
+
+program bar
+ use foo
+ implicit none
+ type(a) c
+ if (c%m /= n) stop 1
+ if (any(c%t /= ['a', 'b', 'c', 'd', 'e'])) stop 2
+end program bar