re PR fortran/85395 ([F03] private clause contained in derived type acquires spurious scope)

fix PR 85395

2018-09-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/85395
	* decl.c (match_binding_attributes): Use correct default accessibility
	for procedure pointer components.

2018-09-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/85395
	* gfortran.dg/proc_ptr_comp_52.f90: New test case.

From-SVN: r264196
This commit is contained in:
Janus Weil 2018-09-10 23:25:33 +02:00
parent 6f2dde9cf6
commit d4beaf2a22
4 changed files with 46 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2018-09-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/85395
* decl.c (match_binding_attributes): Use correct default accessibility
for procedure pointer components.
2018-09-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* simplify.c (gfc_simplify_modulo): Re-arrange code to test whether

View File

@ -10570,7 +10570,8 @@ match_binding_attributes (gfc_typebound_proc* ba, bool generic, bool ppc)
done:
if (ba->access == ACCESS_UNKNOWN)
ba->access = gfc_typebound_default_access;
ba->access = ppc ? gfc_current_block()->component_access
: gfc_typebound_default_access;
if (ppc && !seen_ptr)
{

View File

@ -1,3 +1,8 @@
2018-09-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/85395
* gfortran.dg/proc_ptr_comp_52.f90: New test case.
2018-09-08 Marek Polacek <polacek@redhat.com>
PR c++/87150 - wrong ctor with maybe-rvalue semantics.

View File

@ -0,0 +1,33 @@
! { dg-do compile }
!
! PR 85395: [F03] private clause contained in derived type acquires spurious scope
!
! Contributed by <cfd@mnet-mail.de>
module defs
implicit none
type :: base
contains
private
end type
type :: options
procedure(), pointer, nopass :: ptr
end type
type :: t
private
procedure(), pointer, nopass, public :: ptr
end type
end module
program p
use defs
implicit none
type(options) :: self
type(t) :: dt
self%ptr => null()
dt%ptr => null()
end