[Bug fortran/47572] [OOP] Invalid: Allocatable polymorphic with init expression.

2016-11-16 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47572

janus at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.6.0

[Bug fortran/47572] [OOP] Invalid: Allocatable polymorphic with init expression.

2011-02-02 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47572

--- Comment #2 from janus at gcc dot gnu.org 2011-02-02 13:11:54 UTC ---
Author: janus
Date: Wed Feb  2 13:11:50 2011
New Revision: 169520

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=169520
Log:
2011-02-02  Janus Weil  ja...@gcc.gnu.org

PR fortran/47572
* resolve.c (resolve_fl_variable): Handle polymorphic allocatables.


2011-02-02  Janus Weil  ja...@gcc.gnu.org

PR fortran/47572
* gfortran.dg/class_36.f03: New.

Added:
trunk/gcc/testsuite/gfortran.dg/class_36.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/47572] [OOP] Invalid: Allocatable polymorphic with init expression.

2011-02-02 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47572

janus at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #3 from janus at gcc dot gnu.org 2011-02-02 13:12:56 UTC ---
Fixed with r169520. Closing.


[Bug fortran/47572] [OOP] Invalid: Allocatable polymorphic with init expression.

2011-02-01 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47572

janus at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011.02.01 15:52:21
 AssignedTo|unassigned at gcc dot   |janus at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1

--- Comment #1 from janus at gcc dot gnu.org 2011-02-01 15:52:21 UTC ---
The following should be enough to fix it:

Index: gcc/fortran/resolve.c
===
--- gcc/fortran/resolve.c   (revision 169479)
+++ gcc/fortran/resolve.c   (working copy)
@@ -10063,7 +10063,8 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
   /* 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)