diff options
author | Tobias Burnus <burnus@net-b.de> | 2010-11-12 00:07:23 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-11-12 00:07:23 +0100 |
commit | d5656544848558da436c8f33055b2ca2cc3a18ef (patch) | |
tree | 125b58d69b7782f92437df2511f9119e7000cc4d /gcc/fortran/resolve.c | |
parent | dc09b1077d0acd283afffd5eb09dda34b9f6ba95 (diff) | |
download | gcc-d5656544848558da436c8f33055b2ca2cc3a18ef.zip gcc-d5656544848558da436c8f33055b2ca2cc3a18ef.tar.gz gcc-d5656544848558da436c8f33055b2ca2cc3a18ef.tar.bz2 |
re PR fortran/46413 ([OOP] ICE when printing a polymorphic type)
2010-11-11 Tobias Burnus <burnus@net-b.de>
PR fortran/46413
* resolve.c (resolve_transfer): Reject I/O transfer of
polymorphic type.
PR fortran/46205
* resolve.c (resolve_code): Reject nonscalar FORALL masks.
2010-11-11 Tobias Burnus <burnus@net-b.de>
PR fortran/46413
* gfortran.dg/class_31.f90: New.
PR fortran/46205
* gfortran.dg/forall_14.f90: New.
From-SVN: r166631
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 1f5630d..60a15d8 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -7949,6 +7949,15 @@ resolve_transfer (gfc_code *code) if (ref->type == REF_COMPONENT) ts = &ref->u.c.component->ts; + if (ts->type == BT_CLASS) + { + /* FIXME: Test for defined input/output. */ + gfc_error ("Data transfer element at %L cannot be polymorphic unless " + "it is processed by a defined input/output procedure", + &code->loc); + return; + } + if (ts->type == BT_DERIVED) { /* Check that transferred derived type doesn't contain POINTER @@ -9099,8 +9108,9 @@ resolve_code (gfc_code *code, gfc_namespace *ns) case EXEC_FORALL: resolve_forall_iterators (code->ext.forall_iterator); - if (code->expr1 != NULL && code->expr1->ts.type != BT_LOGICAL) - gfc_error ("FORALL mask clause at %L requires a LOGICAL " + if (code->expr1 != NULL + && (code->expr1->ts.type != BT_LOGICAL || code->expr1->rank)) + gfc_error ("FORALL mask clause at %L requires a scalar LOGICAL " "expression", &code->expr1->where); break; |