===================================================================
@@ -11705,7 +11705,8 @@ resolve_fl_var_and_proc (gfc_symbol *sym
/* Assume that use associated symbols were checked in the module ns.
Class-variables that are associate-names are also something special
and excepted from the test. */
- if (!sym->attr.class_ok && !sym->attr.use_assoc && !sym->assoc)
+ if (!sym->attr.class_ok && !sym->attr.use_assoc && !sym->attr.dummy
+ && !sym->assoc)
{
gfc_error ("CLASS variable %qs at %L must be dummy, allocatable "
"or pointer", sym->name, &sym->declared_at);
===================================================================
@@ -0,0 +1,38 @@
+! { dg-do compile }
+module gfc_base
+
+ implicit none
+
+ integer, parameter:: INTD=4
+ integer, parameter:: INTL=8
+ integer(INTD), parameter :: GFC_FALSE=0
+
+ type gfc_cont_elem_t
+ class(*), pointer, private:: value_p=>NULL()
+ integer(INTD), private:: alloc=GFC_FALSE
+ contains
+ procedure, public:: construct=>ContElemConstruct
+ end type gfc_cont_elem_t
+
+ abstract interface
+ function gfc_copy_i(obj,ierr) result(clone)
+ import:: INTD
+ class(*), pointer:: clone
+ class(*), intent(in):: obj
+ integer(INTD), intent(out), optional:: ierr
+ end function gfc_copy_i
+ end interface
+
+ private ContElemConstruct
+
+ contains
+
+ subroutine ContElemConstruct(this,obj,ierr,assoc_only,copy_constr_func)
+ class(gfc_cont_elem_t), intent(inout):: this
+ class(*), target, intent(in):: obj
+ integer(INTD), intent(out), optional:: ierr
+ logical, intent(in), optional:: assoc_only
+ procedure(gfc_copy_i), optional:: copy_constr_func
+ end subroutine ContElemConstruct
+
+ end module gfc_base