diff options
author | Tobias Burnus <burnus@net-b.de> | 2011-09-14 08:26:07 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2011-09-14 08:26:07 +0200 |
commit | ea8ad3e527332487c4e395a95d9588873a58a99b (patch) | |
tree | ea05e76ae4fb515f8b3075f732a237a358ae0f9f /gcc/fortran/resolve.c | |
parent | 95a45b570dac0fa415570b77a8ac874caba8481f (diff) | |
download | gcc-ea8ad3e527332487c4e395a95d9588873a58a99b.zip gcc-ea8ad3e527332487c4e395a95d9588873a58a99b.tar.gz gcc-ea8ad3e527332487c4e395a95d9588873a58a99b.tar.bz2 |
re PR fortran/34547 (NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid)
2011-09-14 Tobias Burnus <burnus@net-b.de>
PR fortran/34547
PR fortran/50375
* check.c (gfc_check_null): Allow allocatables as MOLD to NULL.
* resolve.c (resolve_transfer): Reject NULL without MOLD.
* interface.c (gfc_procedure_use): Reject NULL without MOLD
if no explicit interface is known.
(gfc_search_interface): Reject NULL without MOLD if it would
lead to ambiguity.
2011-09-14 Tobias Burnus <burnus@net-b.de>
PR fortran/34547
PR fortran/50375
* gfortran.dg/null_5.f90: New.
* gfortran.dg/null_6.f90: New.
From-SVN: r178841
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index b038402..9aab836 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -8150,6 +8150,13 @@ resolve_transfer (gfc_code *code) && exp->value.op.op == INTRINSIC_PARENTHESES) exp = exp->value.op.op1; + if (exp && exp->expr_type == EXPR_NULL && exp->ts.type == BT_UNKNOWN) + { + gfc_error ("NULL intrinsic at %L in data transfer statement requires " + "MOLD=", &exp->where); + return; + } + if (exp == NULL || (exp->expr_type != EXPR_VARIABLE && exp->expr_type != EXPR_FUNCTION)) return; |