3 ! PR 44912: [OOP] Segmentation fault on TBP
5 ! Contributed by Satish.BD <bdsatish@gmail.com>
12 type, public :: polynom
13 complex, allocatable, dimension(:) :: a
16 procedure :: init_from_coeff
17 procedure :: get_degree
22 subroutine init_from_coeff(self, coeff)
23 class(polynom), intent(inout) :: self
24 complex, dimension(:), intent(in) :: coeff
25 self%n = size(coeff) - 1
26 allocate(self%a(self%n + 1))
29 end subroutine init_from_coeff
31 function get_degree(self) result(n)
32 class(polynom), intent(in) :: self
36 end function get_degree
38 subroutine add_poly(self)
39 class(polynom), intent(in) :: self
42 s = self%get_degree() !!!! fails here
48 use polynomial, only: polynom
52 call p1%init_from_coeff([(1,0),(2,0),(3,0)])