]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/32360 (GFORTRAN WON'T COMPILE 'DATA PTR1 /NULL ()/' WHEN PTR1 HAS POINT...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 22 Jun 2007 16:21:23 +0000 (16:21 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 22 Jun 2007 16:21:23 +0000 (16:21 +0000)
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

gcc/fortran/ChangeLog
gcc/fortran/expr.c

index befa318e0e9a155f0d6b0d8b91f19652a4f2d6c3..f3238863fa2249afafc7fdbd6a933151af87ea96 100644 (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
index 00ed9a04d77a89a9e7f5592b0d9b58d11032342a..d3f0ddf5ccefbf78901d7cf5fc7a743992b74e42 100644 (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