From: Janus Weil Date: Sat, 3 Dec 2016 09:32:27 +0000 (+0100) Subject: re PR fortran/58175 ([OOP] Incorrect warning message on scalar finalizer) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=802583a210c22cdbabb63d660633af09f0039a32;p=gcc.git re PR fortran/58175 ([OOP] Incorrect warning message on scalar finalizer) 2016-12-03 Janus Weil PR fortran/58175 * resolve.c (gfc_resolve_finalizers): Prevent bogus warning. 2016-12-03 Janus Weil PR fortran/58175 * gfortran.dg/finalize_30.f90: Extend test case. From-SVN: r243218 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 68d0559013b..7a007c30251 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2016-12-03 Janus Weil + + PR fortran/58175 + * resolve.c (gfc_resolve_finalizers): Prevent bogus warning. + 2016-12-02 Steven G. Kargl * simplify.c (gfc_convert_char_constant): Free result on error. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 152678fbe0b..7bc9f5f5b6f 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -12517,7 +12517,7 @@ error: /* Warn if we haven't seen a scalar finalizer procedure (but we know there were nodes in the list, must have been for arrays. It is surely a good idea to have a scalar version there if there's something to finalize. */ - if (warn_surprising && result && !seen_scalar) + if (warn_surprising && derived->f2k_derived->finalizers && !seen_scalar) gfc_warning (OPT_Wsurprising, "Only array FINAL procedures declared for derived type %qs" " defined at %L, suggest also scalar one", diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 103906be84e..39a5c595a23 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-12-03 Janus Weil + + PR fortran/58175 + * gfortran.dg/finalize_30.f90: Extend test case. + 2016-12-02 Jakub Jelinek PR c++/78649 diff --git a/gcc/testsuite/gfortran.dg/finalize_30.f90 b/gcc/testsuite/gfortran.dg/finalize_30.f90 index 281bfaa0161..b93a3d50645 100644 --- a/gcc/testsuite/gfortran.dg/finalize_30.f90 +++ b/gcc/testsuite/gfortran.dg/finalize_30.f90 @@ -10,6 +10,8 @@ module ct contains final :: aD end type + type, extends(a) :: a1 + end type contains subroutine aD(self) type(a), intent(inout) :: self