re PR fortran/32360 (GFORTRAN WON'T COMPILE 'DATA PTR1 /NULL ()/' WHEN PTR1 HAS POINTER ATTRIBUTE)

2007-06-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/32360
	* expr.c (gfc_check_assign): If the rvalue expression type is NULL_EXPR,
	check to see if the lvalue has attribute pointer and data.

From-SVN: r125949
This commit is contained in:
Jerry DeLisle 2007-06-22 16:21:23 +00:00
parent 9064c53336
commit 37775e79ee
2 changed files with 18 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2007-06-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/32360
* expr.c (gfc_check_assign): If the rvalue expression type is NULL_EXPR,
check to see if the lvalue has attribute pointer and data.
2007-06-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/31162

View File

@ -2407,12 +2407,18 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
return FAILURE;
}
if (rvalue->expr_type == EXPR_NULL)
{
gfc_error ("NULL appears on right-hand side in assignment at %L",
&rvalue->where);
return FAILURE;
}
if (rvalue->expr_type == EXPR_NULL)
{
if (lvalue->symtree->n.sym->attr.pointer
&& lvalue->symtree->n.sym->attr.data)
return SUCCESS;
else
{
gfc_error ("NULL appears on right-hand side in assignment at %L",
&rvalue->where);
return FAILURE;
}
}
if (sym->attr.cray_pointee
&& lvalue->ref != NULL