https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83515
Dominique d'Humieres <dominiq at lps dot ens.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-12-22 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Self-contained reduced test for gfortran 7.2.0 and trunk (8.0) module gfc_base implicit none type, public:: gfc_cont_elem_t class(*), pointer, private:: value_p=>NULL() contains procedure, public:: construct_base=>ContElemConstruct end type gfc_cont_elem_t abstract interface function gfc_copy_i(obj,ierr) result(clone) class(*), pointer:: clone class(*), intent(in), target:: obj integer(4), intent(out), optional:: ierr end function gfc_copy_i end interface private ContElemConstruct contains subroutine ContElemConstruct(this,obj,ierr,assoc_only,copy_ctor_f,locked) !`GCC/5.3.0 has a bug with this line implicit none class(gfc_cont_elem_t), intent(inout):: this class(*), intent(in), target:: obj integer(4), intent(out), optional:: ierr logical, intent(in), optional:: assoc_only procedure(gfc_copy_i), optional:: copy_ctor_f logical, intent(in), optional:: locked end subroutine ContElemConstruct end module gfc_base module gfc_vector use gfc_base implicit none private type, extends(gfc_cont_elem_t), public:: vector_elem_t contains procedure, private:: VectorElemConstruct end type vector_elem_t contains subroutine VectorElemConstruct(this,obj,ierr,assoc_only,copy_ctor_f) !`GCC has a bug with this line implicit none class(vector_elem_t), intent(inout):: this class(*), target, intent(in):: obj integer(4), intent(out), optional:: ierr logical, intent(in), optional:: assoc_only procedure(gfc_copy_i), optional:: copy_ctor_f integer(4) :: errc call this%construct_base(obj,errc,copy_ctor_f=copy_ctor_f) end subroutine VectorElemConstruct end module gfc_vector Gfortran 6.4.0 and earlier gives the error subroutine ContElemConstruct(this,obj,ierr,assoc_only,copy_ctor_f,locked) !`GCC/5.3.0 has a bug with this line 1 Error: CLASS variable 'copy_ctor_f' at (1) must be dummy, allocatable or pointer