Hello world,

The attached patch fixes an ICE when an UNSIGNED-specific constant
is used from ISO_FORTRAN_ENV.  The error message is not particularly
great, it is

Error: Unsigned: The symbol 'uint32', referenced at (1), is not in the selected standard

but it is better than an ICE.

OK for trunk?

Best regards

        Thomas

gcc/fortran/ChangeLog:

        * error.cc (notify_std_msg): Handle GFC_STD_UNSIGNED.

gcc/testsuite/ChangeLog:

        * gfortran.dg/unsigned_37.f90: New test.
diff --git a/gcc/fortran/error.cc b/gcc/fortran/error.cc
index d184ffd878a..afe2e49e499 100644
--- a/gcc/fortran/error.cc
+++ b/gcc/fortran/error.cc
@@ -362,6 +362,8 @@ notify_std_msg(int std)
     return _("Obsolescent feature:");
   else if (std & GFC_STD_F95_DEL)
     return _("Deleted feature:");
+  else if (std & GFC_STD_UNSIGNED)
+    return _("Unsigned:");
   else
     gcc_unreachable ();
 }
diff --git a/gcc/testsuite/gfortran.dg/unsigned_37.f90 b/gcc/testsuite/gfortran.dg/unsigned_37.f90
new file mode 100644
index 00000000000..b11f214336a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/unsigned_37.f90
@@ -0,0 +1,4 @@
+! { dg-do compile }
+program main
+  use iso_fortran_env, only : uint32 ! { dg-error "not in the selected standard" }
+end program main

Reply via email to