if (c->ts.type == BT_CLASS)
{
attr = &CLASS_DATA (c)->attr;
- if (attr->class_pointer)
+ if (attr->class_pointer || c->attr.proc_pointer)
continue;
}
else
{
attr = &c->attr;
- if (attr->pointer)
+ if (attr->pointer || attr->proc_pointer)
continue;
}
--- /dev/null
+!{ dg-do run }
+
+! Check that components of procedure pointer aren't freeed.
+! Contributed by Damian Rouson <damian@archaeologic.codes>
+
+ implicit none
+
+ type foo_t
+ integer, allocatable :: i_
+ procedure(f), pointer, nopass :: f_
+ procedure(c), pointer, nopass :: c_
+ end type
+
+ class(foo_t), allocatable :: ff
+
+ associate(foo => foo_t(1,f))
+ end associate
+
+contains
+
+ function f()
+ logical, allocatable :: f
+ f = .true.
+ end function
+
+ function c()
+ class(foo_t), allocatable :: c
+ allocate(c)
+ end function
+end