+2018-03-01 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/84219
+ * target-memory.c (gfc_interpret_derived): Assert that BT_VOID
+ components are caf tokens.
+ (gfc_target_interpret_expr): Treat BT_VOID expressions as
+ integers.
+
2018-03-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/84538
gcc_assert (ptr % 8 == 0);
ptr = ptr/8 + TREE_INT_CST_LOW (DECL_FIELD_OFFSET (cmp->backend_decl));
+ gcc_assert (e->ts.type != BT_VOID || cmp->attr.caf_token);
gfc_target_interpret_expr (&buffer[ptr], buffer_size - ptr, e, true);
}
gcc_assert (result->representation.length >= 0);
break;
+ case BT_VOID:
+ /* This deals with caf_tokens. */
+ result->representation.length =
+ gfc_interpret_integer (result->ts.kind, buffer, buffer_size,
+ result->value.integer);
+ break;
+
default:
gfc_internal_error ("Invalid expression in gfc_target_interpret_expr.");
break;
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+!
+! Contributed by G Steinmetz <gscfq@t-online.de>
+!
+program p
+ type t
+ integer, allocatable :: t
+ end type
+ type(t) :: x
+ integer :: i = -1
+ print *, transfer(i, x) ! { dg-error "cannot have ALLOCATABLE components" }
+end