aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2010-08-27 21:02:15 +0200
committerJanus Weil <janus@gcc.gnu.org>2010-08-27 21:02:15 +0200
commitcbadd64af4764fe75658a20c229050453379841d (patch)
treec5eca6c196ed2d20080321871f9c09dfb0c08787 /gcc/fortran/match.c
parentee1e5e63ec2e20eb118af50d2b29f4099b536d19 (diff)
downloadgcc-cbadd64af4764fe75658a20c229050453379841d.zip
gcc-cbadd64af4764fe75658a20c229050453379841d.tar.gz
gcc-cbadd64af4764fe75658a20c229050453379841d.tar.bz2
re PR fortran/45420 ([OOP] polymorphic TBP call in a CLASS DEFAULT clause)
2010-08-27 Janus Weil <janus@gcc.gnu.org> PR fortran/45420 * match.c (select_type_set_tmp): Add the possibility to reset the temporary to NULL. (gfc_match_class_is): Reset the temporary in CLASS DEFAULT clauses. 2010-08-27 Janus Weil <janus@gcc.gnu.org> PR fortran/45420 * gfortran.dg/select_type_15.f03: New. From-SVN: r163594
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 21dbcde..7c0dfc7 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -4460,6 +4460,12 @@ select_type_set_tmp (gfc_typespec *ts)
char name[GFC_MAX_SYMBOL_LEN];
gfc_symtree *tmp;
+ if (!ts)
+ {
+ select_type_stack->tmp = NULL;
+ return;
+ }
+
if (!gfc_type_is_extensible (ts->u.derived))
return;
@@ -4708,6 +4714,7 @@ gfc_match_class_is (void)
c->where = gfc_current_locus;
c->ts.type = BT_UNKNOWN;
new_st.ext.case_list = c;
+ select_type_set_tmp (NULL);
return MATCH_YES;
}