aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-09-14 08:26:07 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2011-09-14 08:26:07 +0200
commitea8ad3e527332487c4e395a95d9588873a58a99b (patch)
treeea05e76ae4fb515f8b3075f732a237a358ae0f9f /gcc/fortran/check.c
parent95a45b570dac0fa415570b77a8ac874caba8481f (diff)
downloadgcc-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/check.c')
-rw-r--r--gcc/fortran/check.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 3d4f4c8..5b692ee 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -2732,14 +2732,20 @@ gfc_check_null (gfc_expr *mold)
attr = gfc_variable_attr (mold, NULL);
- if (!attr.pointer && !attr.proc_pointer)
+ if (!attr.pointer && !attr.proc_pointer && !attr.allocatable)
{
- gfc_error ("'%s' argument of '%s' intrinsic at %L must be a POINTER",
+ gfc_error ("'%s' argument of '%s' intrinsic at %L must be a POINTER, "
+ "ALLOCATABLE or procedure pointer",
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &mold->where);
return FAILURE;
}
+ if (attr.allocatable
+ && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: NULL intrinsic with "
+ "allocatable MOLD at %L", &mold->where) == FAILURE)
+ return FAILURE;
+
/* F2008, C1242. */
if (gfc_is_coindexed (mold))
{