diff options
author | Janus Weil <janus@gcc.gnu.org> | 2011-02-02 14:11:50 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2011-02-02 14:11:50 +0100 |
commit | da285ce8e420f2827fdf855fc97c7c23bd4b6d23 (patch) | |
tree | 61cdc6bbaf1a36bf6e300c2019dba35ce8db3ef4 /gcc/fortran/resolve.c | |
parent | 5cbf5c20cf75fd44392400db11f3838aec114443 (diff) | |
download | gcc-da285ce8e420f2827fdf855fc97c7c23bd4b6d23.zip gcc-da285ce8e420f2827fdf855fc97c7c23bd4b6d23.tar.gz gcc-da285ce8e420f2827fdf855fc97c7c23bd4b6d23.tar.bz2 |
re PR fortran/47572 ([OOP] Invalid: Allocatable polymorphic with init expression.)
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
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 2a0fc49..7f3734e 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -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) |