Commit 0e4cb16f by Janus Weil

re PR fortran/87172 (Spurious "Derived type 'c_funptr' at (1) has not been…

re PR fortran/87172 (Spurious "Derived type 'c_funptr' at (1) has not been declared" error after r263782)

fix PR 87172

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

	PR fortran/87172
	* resolve.c (resolve_fl_derived): If a type has the 'use_assoc'
	attribute, then it was declared in another module, so there should be
	no error that it has not been declared.

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

	PR fortran/87172
	* gfortran.dg/iso_c_binding_only_2.f90: New test case.

From-SVN: r264214
parent 2e3d2422
2018-09-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/87172
* resolve.c (resolve_fl_derived): If a type has the 'use_assoc'
attribute, then it was declared in another module, so there should be
no error that it has not been declared.
2018-09-11 Paul Thomas <pault@gcc.gnu.org> 2018-09-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/87277 PR fortran/87277
......
...@@ -14245,7 +14245,7 @@ resolve_fl_derived (gfc_symbol *sym) ...@@ -14245,7 +14245,7 @@ resolve_fl_derived (gfc_symbol *sym)
&sym->declared_at)) &sym->declared_at))
return false; return false;
if (sym->components == NULL && !sym->attr.zero_comp) if (sym->components == NULL && !sym->attr.zero_comp && !sym->attr.use_assoc)
{ {
gfc_error ("Derived type %qs at %L has not been declared", gfc_error ("Derived type %qs at %L has not been declared",
sym->name, &sym->declared_at); sym->name, &sym->declared_at);
......
2018-09-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/87172
* gfortran.dg/iso_c_binding_only_2.f90: New test case.
2018-09-11 Paul Thomas <pault@gcc.gnu.org> 2018-09-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/87277 PR fortran/87277
......
! { dg-do compile }
!
! PR 87172: [9 Regression] Spurious "Derived type 'c_funptr' at (1) has not been declared" error after r263782
!
! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr>
module m1
use iso_c_binding, only: c_funptr
end module
module m2
use m1
use iso_c_binding
end module
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