PR fortran/69385
* trans-expr.c (is_scalar_reallocatable_lhs): Remove the check
for allocatable components, whilst checking if the symbol is a
derived or class entity..
2015-01-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/69385
* gfortran.dg/alloc_comp_assign_15.f03: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232904
138bc75d-0d04-0410-961f-
82ee72b054a4
+2016-01-27 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/69385
+ * trans-expr.c (is_scalar_reallocatable_lhs): Remove the check
+ for allocatable components, whilst checking if the symbol is a
+ derived or class entity..
+
2016-01-26 Paul Thomas <pault@gcc.gnu.org>
PR fortran/69385
&& !expr->ref)
return true;
- /* All that can be left are allocatable components. */
- if ((expr->symtree->n.sym->ts.type != BT_DERIVED
+ /* All that can be left are allocatable components. However, we do
+ not check for allocatable components here because the expression
+ could be an allocatable component of a pointer component. */
+ if (expr->symtree->n.sym->ts.type != BT_DERIVED
&& expr->symtree->n.sym->ts.type != BT_CLASS)
- || !expr->symtree->n.sym->ts.u.derived->attr.alloc_comp)
return false;
/* Find an allocatable component ref last. */
+2015-01-27 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/69385
+ * gfortran.dg/alloc_comp_assign_15.f03: New test.
+
2016-01-27 Jakub Jelinek <jakub@redhat.com>
PR debug/66869
--- /dev/null
+! { dg-do run }
+!
+! Check the test for PR69422, in which the allocatable component 'Source'
+! of the pointer component 'P' was not automatically (re)allocated on
+! assignment.
+!
+! Contributed by Anthony Lewis <antony@cosmologist.info>
+!
+module funcs
+ implicit none
+
+ Type T
+ character(LEN=:), allocatable :: source
+ end type T
+
+ type TPointer
+ Type(T), pointer :: P
+ end type TPointer
+
+end module
+
+program Test1
+ use funcs
+ Type(TPointer) :: X
+
+ allocate(X%P)
+
+ X%P%Source = 'test string'
+ if (.not.allocated (X%P%Source)) call abort
+ if (X%P%Source .ne. 'test string') call abort
+
+end program Test1