This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/45290] [F08] pointer initialization


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45290

--- Comment #16 from janus at gcc dot gnu.org ---
(In reply to janus from comment #13)
> (2) We currently get a slightly inappropriate error message for:
> 
>  implicit none
>  integer, target, save  :: t1
>  integer, pointer :: p1 => t
> end

This can be fixed with the following patch (not regtested yet):

Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c    (revision 208590)
+++ gcc/fortran/decl.c    (working copy)
@@ -1759,8 +1759,8 @@ match_pointer_init (gfc_expr **init, int procptr)
       return MATCH_ERROR;
     }

-  if (!procptr)
-    gfc_resolve_expr (*init);
+  if (!procptr && !gfc_resolve_expr (*init))
+    return MATCH_ERROR;

   if (!gfc_notify_std (GFC_STD_F2008, "non-NULL pointer "
                "initialization at %C"))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]