This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45290] [F08] pointer initialization
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 15 Mar 2014 15:39:08 +0000
- Subject: [Bug fortran/45290] [F08] pointer initialization
- Auto-submitted: auto-generated
- References: <bug-45290-4 at http dot gcc dot gnu dot org/bugzilla/>
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"))