Fortran: non-standard intrinsics SHORT and LONG have been removed
authorHarald Anlauf <anlauf@gmx.de>
Sat, 30 Oct 2021 18:09:10 +0000 (20:09 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Sat, 30 Oct 2021 18:09:10 +0000 (20:09 +0200)
2021-10-30  Manfred Schwarb  <manfred99@gmx.ch>

gcc/fortran/ChangeLog:

* check.c (gfc_check_intconv): Change error message.

gcc/testsuite/ChangeLog:

* gfortran.dg/intrinsic_short-long.f90: New test.

gcc/fortran/check.c
gcc/testsuite/gfortran.dg/intrinsic_short-long.f90 [new file with mode: 0644]

index cfaf9d2..6ea6e13 100644 (file)
@@ -3240,7 +3240,7 @@ gfc_check_intconv (gfc_expr *x)
   if (strcmp (gfc_current_intrinsic, "short") == 0
       || strcmp (gfc_current_intrinsic, "long") == 0)
     {
-      gfc_error ("%qs intrinsic subprogram at %L has been deprecated.  "
+      gfc_error ("%qs intrinsic subprogram at %L has been removed.  "
                 "Use INT intrinsic subprogram.", gfc_current_intrinsic,
                 &x->where);
       return false;
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_short-long.f90 b/gcc/testsuite/gfortran.dg/intrinsic_short-long.f90
new file mode 100644 (file)
index 0000000..3f3f3cc
--- /dev/null
@@ -0,0 +1,11 @@
+! { dg-do compile }
+!
+! Checking for removal of SHORT and LONG intrinsics.
+!
+  real,parameter :: a=3.1415927
+  integer :: i
+
+  i=SHORT(a) ! { dg-error "has been removed" }
+  i=LONG(a)  ! { dg-error "has been removed" }
+
+  end