diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2018-08-23 06:27:54 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2018-08-23 06:27:54 +0000 |
commit | 6ab6c0c3bb09707f993a748c67087838f6b7d5f9 (patch) | |
tree | 7f33595b13c10f6fd3bd43c4e1e90953ca66ec41 /gcc/fortran/resolve.c | |
parent | ba7a2ad8bdc51dbfaaa1a83b24b0417691a5a80d (diff) | |
download | gcc-6ab6c0c3bb09707f993a748c67087838f6b7d5f9.zip gcc-6ab6c0c3bb09707f993a748c67087838f6b7d5f9.tar.gz gcc-6ab6c0c3bb09707f993a748c67087838f6b7d5f9.tar.bz2 |
re PR fortran/86863 ([OOP][F2008] type-bound module procedure name not recognized)
2017-08-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/86863
* resolve.c (resolve_typebound_call): If the TBP is not marked
as a subroutine, check the specific symbol.
2017-08-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/86863
* gfortran.dg/submodule_32.f08: New test.
From-SVN: r263799
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 4ad4dcf..43a8470 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -6266,9 +6266,17 @@ resolve_typebound_call (gfc_code* c, const char **name, bool *overridable) /* Check that's really a SUBROUTINE. */ if (!c->expr1->value.compcall.tbp->subroutine) { - gfc_error ("%qs at %L should be a SUBROUTINE", - c->expr1->value.compcall.name, &c->loc); - return false; + if (!c->expr1->value.compcall.tbp->is_generic + && c->expr1->value.compcall.tbp->u.specific + && c->expr1->value.compcall.tbp->u.specific->n.sym + && c->expr1->value.compcall.tbp->u.specific->n.sym->attr.subroutine) + c->expr1->value.compcall.tbp->subroutine = 1; + else + { + gfc_error ("%qs at %L should be a SUBROUTINE", + c->expr1->value.compcall.name, &c->loc); + return false; + } } if (!check_typebound_baseobject (c->expr1)) |