summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/class_39.f03
blob: bc8039fc0c522bc4e886a90b73198652d80f22e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
! { dg-do compile }
!
! PR 47745: [OOP] Segfault with CLASS(*) and derived type dummy arguments
!
! Contributed by Rodney Polkinghorne <thisrod@gmail.com>

  type, abstract :: T 
  end type T
contains
  class(T) function add()  ! { dg-error "must be dummy, allocatable or pointer" }
    add = 1  ! { dg-error "Variable must not be polymorphic in assignment" }
  end function
end