+2018-09-11 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/86830
+ * expr.c (gfc_is_simply_contiguous): Handle type-bound procedure calls
+ with non-polymorphic objects.
+
2018-09-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/85395
return expr->value.function.esym->result->attr.contiguous;
else
{
- /* We have to jump through some hoops if this is a vtab entry. */
- gfc_symbol *s;
- gfc_ref *r, *rc;
-
- s = expr->symtree->n.sym;
- if (s->ts.type != BT_CLASS)
+ /* Type-bound procedures. */
+ gfc_symbol *s = expr->symtree->n.sym;
+ if (s->ts.type != BT_CLASS && s->ts.type != BT_DERIVED)
return false;
- rc = NULL;
- for (r = expr->ref; r; r = r->next)
+ gfc_ref *rc = NULL;
+ for (gfc_ref *r = expr->ref; r; r = r->next)
if (r->type == REF_COMPONENT)
rc = r;
+2018-09-11 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/86830
+ * gfortran.dg/typebound_call_30.f90: New test case.
+
2018-09-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/85395
--- /dev/null
+! { dg-do compile }
+!
+! PR 86830: [8/9 Regression] Contiguous array pointer function result not recognized as contiguous
+!
+! Contributed by <only_for_nouse@gmx.de>
+
+module m
+ implicit none
+
+ type :: t1
+ contains
+ procedure :: get_ptr
+ end type
+
+ type :: t2
+ class(t1), allocatable :: c
+ end type
+
+contains
+
+ function get_ptr(this)
+ class(t1) :: this
+ real, dimension(:), contiguous, pointer :: get_ptr
+ end function
+
+ subroutine test()
+ real, dimension(:), contiguous, pointer:: ptr
+ type(t2) :: x
+ ptr => x%c%get_ptr()
+ end subroutine
+
+end module