aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2013-12-01 11:37:09 +0000
committerPaul Thomas <pault@gcc.gnu.org>2013-12-01 11:37:09 +0000
commit49560f0c747c5d62ee46c9118b1ab634e985def5 (patch)
tree593ffc7b21be2cbb5d08c3e3109e806d4ab89d9e /gcc/fortran/resolve.c
parentc931d01d7d439aa992116fa70d22fd407f8cb254 (diff)
downloadgcc-49560f0c747c5d62ee46c9118b1ab634e985def5.zip
gcc-49560f0c747c5d62ee46c9118b1ab634e985def5.tar.gz
gcc-49560f0c747c5d62ee46c9118b1ab634e985def5.tar.bz2
Index...
Index: gcc/fortran/resolve.c =================================================================== *** gcc/fortran/resolve.c (revision 205031) --- gcc/fortran/resolve.c (working copy) *************** resolve_transfer (gfc_code *code) *** 8247,8256 **** && 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; } --- 8247,8257 ---- && exp->value.op.op == INTRINSIC_PARENTHESES) exp = exp->value.op.op1; ! if (exp && exp->expr_type == EXPR_NULL ! && code->ext.dt) { ! gfc_error ("Invalid context for NULL () intrinsic at %L", ! &exp->where); return; } Index: gcc/testsuite/gfortran.dg/null_5.f90 =================================================================== *** gcc/testsuite/gfortran.dg/null_5.f90 (revision 205031) --- gcc/testsuite/gfortran.dg/null_5.f90 (working copy) *************** subroutine test_PR34547_1 () *** 34,40 **** end subroutine test_PR34547_1 subroutine test_PR34547_2 () ! print *, null () ! { dg-error "in data transfer statement requires MOLD" } end subroutine test_PR34547_2 subroutine test_PR34547_3 () --- 34,40 ---- end subroutine test_PR34547_1 subroutine test_PR34547_2 () ! print *, null () ! { dg-error "Invalid context" } end subroutine test_PR34547_2 subroutine test_PR34547_3 () Index: gcc/testsuite/gfortran.dg/null_6.f90 =================================================================== *** gcc/testsuite/gfortran.dg/null_6.f90 (revision 205031) --- gcc/testsuite/gfortran.dg/null_6.f90 (working copy) *************** end subroutine test_PR50375_2 *** 30,34 **** subroutine test_PR34547_3 () integer, allocatable :: i(:) ! print *, NULL(i) end subroutine test_PR34547_3 --- 30,34 ---- subroutine test_PR34547_3 () integer, allocatable :: i(:) ! print *, NULL(i) ! { dg-error "Invalid context for NULL" } end subroutine test_PR34547_3 From-SVN: r205565
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 4befb9fd..d16347d 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -8247,10 +8247,11 @@ 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)
+ if (exp && exp->expr_type == EXPR_NULL
+ && code->ext.dt)
{
- gfc_error ("NULL intrinsic at %L in data transfer statement requires "
- "MOLD=", &exp->where);
+ gfc_error ("Invalid context for NULL () intrinsic at %L",
+ &exp->where);
return;
}