aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2004-07-11 18:58:48 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2004-07-11 18:58:48 +0200
commitf23c56270e1ebe34cbddf05fac21688c8de86845 (patch)
tree760ad390a178c094378f5a63225a13d981a6ef99
parent5f0bbc1b07223a28b3a1d4de378b897ded0e142c (diff)
downloadgcc-f23c56270e1ebe34cbddf05fac21688c8de86845.zip
gcc-f23c56270e1ebe34cbddf05fac21688c8de86845.tar.gz
gcc-f23c56270e1ebe34cbddf05fac21688c8de86845.tar.bz2
re PR fortran/15754 (Accepts assignment of the form P = NULL())
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
-rw-r--r--gcc/fortran/ChangeLog4
-rw-r--r--gcc/testsuite/gfortran.dg/pr15754.f907
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 966221c..c3007b7 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -17,6 +17,10 @@
* 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
index 0000000..6d8e34f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr15754.f90
@@ -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