From dc9a54fa10a05bd30aea60555f8fde6a4aa47733 Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Fri, 16 Jan 2015 13:49:46 +0100 Subject: [PATCH] re PR fortran/45290 ([F08] pointer initialization) 2015-01-16 Janus Weil PR fortran/45290 * decl.c (match_pointer_init): Error out if resolution of init expr failed. 2015-01-16 Janus Weil PR fortran/45290 * gfortran.dg/pointer_init_6.f90: Extended. From-SVN: r219731 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/decl.c | 4 ++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pointer_init_6.f90 | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3fd3cfb5ade..c97de7fca14 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2015-01-16 Janus Weil + + PR fortran/45290 + * decl.c (match_pointer_init): Error out if resolution of init expr + failed. + 2015-01-15 Tobias Burnus * openmp.c (check_symbol_not_pointer, resolve_oacc_data_clauses, diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index dfb760b1441..2a200fca761 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1780,8 +1780,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")) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ffc6794ffe4..4f709fcdb93 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-01-16 Janus Weil + + PR fortran/45290 + * gfortran.dg/pointer_init_6.f90: Extended. + 2015-01-16 Robert Suchanek * gcc.c-torture/compile/20150108.c: New test. diff --git a/gcc/testsuite/gfortran.dg/pointer_init_6.f90 b/gcc/testsuite/gfortran.dg/pointer_init_6.f90 index 428a7dee844..f5e7555c4a7 100644 --- a/gcc/testsuite/gfortran.dg/pointer_init_6.f90 +++ b/gcc/testsuite/gfortran.dg/pointer_init_6.f90 @@ -16,6 +16,7 @@ module m1 integer, pointer :: p2 => p1 ! { dg-error "must have the TARGET attribute" } integer, pointer :: p3 => x%p ! { dg-error "must have the TARGET attribute" } integer, pointer :: p4 => x%i + integer, pointer :: p5 => u ! { dg-error "has no IMPLICIT type" } end module m1 -- 2.30.2