2011-02-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/47572
* resolve.c (resolve_fl_variable): Handle polymorphic allocatables.
2011-02-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/47572
* gfortran.dg/class_36.f03: New.
From-SVN: r169520
+2011-02-02 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47572
+ * resolve.c (resolve_fl_variable): Handle polymorphic allocatables.
+
2011-02-01 Janus Weil <janus@gcc.gnu.org>
PR fortran/47565
/* Reject illegal initializers. */
if (!sym->mark && sym->value)
{
- if (sym->attr.allocatable)
+ if (sym->attr.allocatable || (sym->ts.type == BT_CLASS
+ && CLASS_DATA (sym)->attr.allocatable))
gfc_error ("Allocatable '%s' at %L cannot have an initializer",
sym->name, &sym->declared_at);
else if (sym->attr.external)
+2011-02-02 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47572
+ * gfortran.dg/class_36.f03: New.
+
2011-02-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/47566
--- /dev/null
+! { dg-do compile }
+!
+! PR 47572: [OOP] Invalid: Allocatable polymorphic with init expression.
+!
+! Contributed by Edmondo Giovannozzi <edmondo.giovannozzi@gmail.com>
+! cf. http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/763785b16883ed68
+
+program scalar_allocation
+ type test
+ real :: a
+ end type
+ class (test), allocatable :: b = test(3.4) ! { dg-error "cannot have an initializer" }
+ print *,allocated(b)
+end program