re PR fortran/86587 (Derived-type with attributes BIND(C) and PRIVATE raises an error but standard accepts it)

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/86587
	* symbol.c (verify_bind_c_derived_type): Remove erroneous error
	checking for BIND(C) and PRIVATE attributes.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/86587
	* gfortran.dg/pr86587.f90: New test.

From-SVN: r272524
This commit is contained in:
Steven G. Kargl 2019-06-20 21:39:43 +00:00
parent 145f748f0c
commit 966e7f731e
4 changed files with 29 additions and 10 deletions

View File

@ -1,3 +1,9 @@
2019-06-20 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/86587
* symbol.c (verify_bind_c_derived_type): Remove erroneous error
checking for BIND(C) and PRIVATE attributes.
2019-06-20 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/90937

View File

@ -4529,16 +4529,6 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
curr_comp = curr_comp->next;
} while (curr_comp != NULL);
/* Make sure we don't have conflicts with the attributes. */
if (derived_sym->attr.access == ACCESS_PRIVATE)
{
gfc_error ("Derived type %qs at %L cannot be declared with both "
"PRIVATE and BIND(C) attributes", derived_sym->name,
&(derived_sym->declared_at));
retval = false;
}
if (derived_sym->attr.sequence != 0)
{
gfc_error ("Derived type %qs at %L cannot have the SEQUENCE "

View File

@ -1,3 +1,8 @@
2019-06-20 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/86587
* gfortran.dg/pr86587.f90: New test.
2019-06-20 Iain Sandoe <iain@sandoe.co.uk>
* obj-c++.dg/stubify-1.mm: Adjust options and scan-asm checks.

View File

@ -0,0 +1,18 @@
! { dg-do compile }
! PR fortran/86587
! Code contirubted by Valentin Clement <valentin.clement at env dot ethz dot ch>
!
module mod1
use iso_c_binding
type, bind(c), private :: mytype
integer(c_int) :: i1, i2
end type
end module mod1
module mod2
use iso_c_binding
private
type, bind(c) :: mytype
integer(c_int) :: i1, i2
end type
end module mod2