view gcc/testsuite/gfortran.dg/class_39.f03 @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { 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 "Nonallocatable variable must not be polymorphic in intrinsic assignment" }
  end function
end