re PR fortran/52909 ([F03] Procedure pointers not private to modules)

2012-12-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/52909
	* trans-decl.c (get_proc_pointer_decl): Apply name mangling.


2012-12-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/52909
	* gfortran.dg/proc_ptr_39.f90: New test case.

From-SVN: r194375
This commit is contained in:
Janus Weil 2012-12-11 00:17:43 +01:00
parent c6f0bffeb3
commit 5e4404b808
4 changed files with 38 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-12-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/52909
* trans-decl.c (get_proc_pointer_decl): Apply name mangling.
2012-12-09 Tobias Burnus <burnus@net-b.de> 2012-12-09 Tobias Burnus <burnus@net-b.de>
* trans-array.c (gfc_deallocate_scalar_with_status): Use * trans-array.c (gfc_deallocate_scalar_with_status): Use

View File

@ -1531,6 +1531,14 @@ get_proc_pointer_decl (gfc_symbol *sym)
VAR_DECL, get_identifier (sym->name), VAR_DECL, get_identifier (sym->name),
build_pointer_type (gfc_get_function_type (sym))); build_pointer_type (gfc_get_function_type (sym)));
if (sym->module)
{
/* Apply name mangling. */
gfc_set_decl_assembler_name (decl, gfc_sym_mangled_identifier (sym));
if (sym->attr.use_assoc)
DECL_IGNORED_P (decl) = 1;
}
if ((sym->ns->proc_name if ((sym->ns->proc_name
&& sym->ns->proc_name->backend_decl == current_function_decl) && sym->ns->proc_name->backend_decl == current_function_decl)
|| sym->attr.contained) || sym->attr.contained)

View File

@ -1,3 +1,8 @@
2012-12-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/52909
* gfortran.dg/proc_ptr_39.f90: New test case.
2012-12-10 Richard Sandiford <rdsandiford@googlemail.com> 2012-12-10 Richard Sandiford <rdsandiford@googlemail.com>
* gcc.target/mips/octeon-bbit-2.c: Restructure loops so that no * gcc.target/mips/octeon-bbit-2.c: Restructure loops so that no

View File

@ -0,0 +1,20 @@
! { dg-do compile }
!
! PR 52909: [F03] Procedure pointers not private to modules
!
! Contributed by Andrew Benson <abenson@caltech.edu>
module Module1
procedure(), pointer, private :: procPtr => null()
end module
module Module2
procedure(), pointer, private :: procPtr => null()
end module
program Test
use Module1
use Module2
end program
! { dg-final { cleanup-modules "Module1 Module2" } }