------- Comment #1 from burnus at gcc dot gnu dot org  2010-04-28 08:57 -------
Created an attachment (id=20505)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20505&action=view)
coarray_13.f90 test case

Depending on this fix are constraint checking for coarrays, cf. attached test
case.

  * * *

Current result:
  allocate(t :: z[*])
                  1
Error: Unexpected coarray designator at (1)

Reason: gfc_match_array_ref's corank argument is 0. And the argument is sym->as
or component->as (cf. primary).

 * * *

  class(t), allocatable :: z[:] ! Fails due to "sym->attr.allocatable
                               1
Error: Variable 'z' at (1) is a coarray or has a coarray component and is not
ALLOCATABLE, SAVE nor a dummy argument


See check in resolve.c's resolve_symbol. And I do not really want to add tons
of special cases for BT_CLASS; the check is already quite long:

  /* F2008, C526.  The function-result case was handled above.  */
  if (((sym->ts.type == BT_DERIVED && sym->ts.u.derived->attr.coarray_comp)
       || sym->attr.codimension)
      && !(sym->attr.allocatable || sym->attr.dummy || sym->attr.save
           || sym->ns->proc_name->attr.flavor == FL_MODULE
           || sym->ns->proc_name->attr.is_main_program
           || sym->attr.function || sym->attr.result || sym->attr.use_assoc))

 * * *

Possibly related: PR 41539 (also "as = NULL").


-- 


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

Reply via email to