Commit c0fe5a21 by Janus Weil

[multiple changes]

2016-11-29  Tobias Burnus  <burnus@net-b.de>

	PR fortran/58175
	* resolve.c (gfc_resolve_finalizers): Properly detect scalar finalizers.

2016-11-29  Janus Weil  <janus@gcc.gnu.org>

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

From-SVN: r242960
parent 00738904
2016-11-29 Tobias Burnus <burnus@net-b.de>
PR fortran/58175
* resolve.c (gfc_resolve_finalizers): Properly detect scalar finalizers.
2016-11-27 Paul Thomas <pault@gcc.gnu.org> 2016-11-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/78474 PR fortran/78474
......
...@@ -12395,6 +12395,9 @@ gfc_resolve_finalizers (gfc_symbol* derived, bool *finalizable) ...@@ -12395,6 +12395,9 @@ gfc_resolve_finalizers (gfc_symbol* derived, bool *finalizable)
/* Skip this finalizer if we already resolved it. */ /* Skip this finalizer if we already resolved it. */
if (list->proc_tree) if (list->proc_tree)
{ {
if (list->proc_tree->n.sym->formal->sym->as == NULL
|| list->proc_tree->n.sym->formal->sym->as->rank == 0)
seen_scalar = true;
prev_link = &(list->next); prev_link = &(list->next);
continue; continue;
} }
...@@ -12489,7 +12492,7 @@ gfc_resolve_finalizers (gfc_symbol* derived, bool *finalizable) ...@@ -12489,7 +12492,7 @@ gfc_resolve_finalizers (gfc_symbol* derived, bool *finalizable)
} }
/* Is this the/a scalar finalizer procedure? */ /* Is this the/a scalar finalizer procedure? */
if (!arg->as || arg->as->rank == 0) if (my_rank == 0)
seen_scalar = true; seen_scalar = true;
/* Find the symtree for this procedure. */ /* Find the symtree for this procedure. */
......
2016-11-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/58175
* gfortran.dg/finalize_30.f90: New test case.
2016-11-29 Martin Liska <mliska@suse.cz> 2016-11-29 Martin Liska <mliska@suse.cz>
PR gcov-profile/78582 PR gcov-profile/78582
......
! { dg-do compile }
! { dg-options "-Wsurprising" }
!
! PR 58175: [OOP] Incorrect warning message on scalar finalizer
!
! Contributed by Andrew Benson <abensonca@gmail.com>
module ct
type :: a
contains
final :: aD
end type
contains
subroutine aD(self)
type(a), intent(inout) :: self
end subroutine
end module
program test
use ct
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment