http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57590

--- Comment #8 from janus at gcc dot gnu.org ---
(In reply to janus from comment #5)
> Index: gcc/fortran/class.c
> ===================================================================
> --- gcc/fortran/class.c       (revision 201871)
> +++ gcc/fortran/class.c       (working copy)
> @@ -636,7 +636,12 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_a
>        c->attr.dimension = attr->dimension;
>        c->attr.codimension = attr->codimension;
>        c->attr.abstract = fclass->attr.abstract;
> -      c->as = (*as);
> +      if (*as)
> +     {
> +       c->as = (*as);
> +       if (c->as->type == AS_EXPLICIT)
> +         c->as->type = AS_ASSUMED_SHAPE;
> +     }
>        c->initializer = NULL;
>  
>        /* Add component '_vptr'.  */


This shows the following testsuite failure:

FAIL: gfortran.dg/coarray_poly_3.f90  -O   (test for errors, line 25)
FAIL: gfortran.dg/coarray_poly_3.f90  -O  (test for excess errors)


That is, on the following code ...

function func() ! { dg-error "shall not be a coarray or have a coarray
component" }
  type t
  end type t
  class(t), allocatable :: func[*]
end

... it does not give the expected error, but instead:

coarray_poly_3.f90:25:

function func() ! { dg-error "shall not be a coarray or have a coarray
component" }
1
Error: Assumed shape array at (1) must be a dummy argument

Reply via email to