summaryrefslogtreecommitdiff
path: root/gcc/fortran/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/class.c')
-rw-r--r--gcc/fortran/class.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 7117e836156..be4959a7dee 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -1427,6 +1427,12 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns,
gfc_expr *ancestor_wrapper = NULL, *rank;
gfc_iterator *iter;
+ if (derived->attr.unlimited_polymorphic)
+ {
+ vtab_final->initializer = gfc_get_null_expr (NULL);
+ return;
+ }
+
/* Search for the ancestor's finalizers. */
if (derived->attr.extension && derived->components
&& (!derived->components->ts.u.derived->attr.abstract