re PR fortran/15754 (Accepts assignment of the form P = NULL())
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Sun, 11 Jul 2004 16:58:48 +0000 (18:58 +0200)
committerTobias Schlüter <tobi@gcc.gnu.org>
Sun, 11 Jul 2004 16:58:48 +0000 (18:58 +0200)
fortran/
PR fortran/15754
* expr.c (gfc_check_assign): Print ranks if incompatible. Issue
warning if assigning NULL().

testsuite/
PR fortran/17574
* gfortran.dg/pr15754.f90: New test.
the changes to expr.c were accidentally committed previously

From-SVN: r84521

gcc/fortran/ChangeLog
gcc/testsuite/gfortran.dg/pr15754.f90 [new file with mode: 0644]

index 966221c932af572d21c4658132898728e38999f6..c3007b7cb81ff0487d6816ea9d55a161009fab58 100644 (file)
        * primary.c (match_boz_constant): Call gfc_notify_std only if
        we actually have a non-standard boz-literal-constant.
 
+       PR fortran/15754
+       * expr.c (gfc_check_assign): Print ranks if incompatible. Issue
+       warning if assigning NULL().
+
 2004-07-11  Joseph S. Myers  <jsm@polyomino.org.uk>
 
        * f95-lang.c (set_block): Remove.
diff --git a/gcc/testsuite/gfortran.dg/pr15754.f90 b/gcc/testsuite/gfortran.dg/pr15754.f90
new file mode 100644 (file)
index 0000000..6d8e34f
--- /dev/null
@@ -0,0 +1,7 @@
+! we didn't give a warning if the RHS of an assignment was NULL
+! { dg-do-compile }
+INTEGER, POINTER :: P
+I = NULL() ! { dg-warning "NULL appears" "Assignment non-pointer = NULL" }
+P = NULL() ! { dg-warning "NULL appears" "Assignment pointer = NULL" }
+P => NULL()
+END