+2011-07-23 Tobias Burnus <burnus@net-b.de>
+
+ * resolve.c (resolve_symbol): Fix coarray var decl check.
+
2011-07-21 Daniel Carrera <dcarrera@gmail.com>
* trans.c (gfc_allocate_with_status): Split into two functions
sym->name, &sym->declared_at);
/* 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)
+ if (sym->attr.codimension
&& !(sym->attr.allocatable || sym->attr.dummy || sym->attr.save
|| sym->ns->save_all
|| 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))
- gfc_error ("Variable '%s' at %L is a coarray or has a coarray "
- "component and is not ALLOCATABLE, SAVE nor a "
- "dummy argument", sym->name, &sym->declared_at);
+ gfc_error ("Variable '%s' at %L is a coarray and is not ALLOCATABLE, SAVE "
+ "nor a dummy argument", sym->name, &sym->declared_at);
/* F2008, C528. */ /* FIXME: sym->as check due to PR 43412. */
else if (sym->attr.codimension && !sym->attr.allocatable
&& sym->as && sym->as->cotype == AS_DEFERRED)
+2011-07-23 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/coarray_25.f90: New.
+
2011-07-22 Ville Voutilainen <ville.voutilainen@gmail.com>
* override1.C: This test should use c++0x mode.
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+!
+! Used to be rejected with:
+! Error: Variable 'x' at (1) is a coarray or has a coarray
+! component and is not ALLOCATABLE, SAVE nor a dummy argument
+!
+! Is valid as "a" is allocatable, cf. C526
+! and http://j3-fortran.org/pipermail/j3/2011-June/004403.html
+!
+
+ subroutine test2()
+ type t
+ integer, allocatable :: a(:)[:]
+ end type t
+ type(t) :: x
+ allocate(x%a(1)[*])
+ end subroutine test2