re PR fortran/58175 ([OOP] Incorrect warning message on scalar finalizer)

2016-12-03  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58175
	* resolve.c (gfc_resolve_finalizers): Prevent bogus warning.

2016-12-03  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58175
	* gfortran.dg/finalize_30.f90: Extend test case.

From-SVN: r243218
This commit is contained in:
Janus Weil 2016-12-03 10:32:27 +01:00
parent 98ff2d6b12
commit 802583a210
4 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2016-12-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/58175
* resolve.c (gfc_resolve_finalizers): Prevent bogus warning.
2016-12-02 Steven G. Kargl <kargl@gcc.gnu.org>
* simplify.c (gfc_convert_char_constant): Free result on error.

View file

@ -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",

View file

@ -1,3 +1,8 @@
2016-12-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/58175
* gfortran.dg/finalize_30.f90: Extend test case.
2016-12-02 Jakub Jelinek <jakub@redhat.com>
PR c++/78649

View file

@ -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