[Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument

anlauf at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 24 22:10:27 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #2 from anlauf at gcc dot gnu.org ---
The nearly obvious fix:

diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 837eb0912c0..3859e18c6c3 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -1031,7 +1031,7 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
            break;
        }

-      if (!ref)
+      if (!ref && !pointer)
        {
          gfc_error ("%qs argument of %qs intrinsic at %L cannot be "
                     "INTENT(IN)", gfc_current_intrinsic_arg[n]->name,

regresses for gfortran.dg/move_alloc_8.f90, thus needs additional
investigation.


More information about the Gcc-bugs mailing list