aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2009-06-27 00:11:15 +0200
committerJanus Weil <janus@gcc.gnu.org>2009-06-27 00:11:15 +0200
commitfc9c6e5d64f4dbdc1f7a53a4fa14ddc3f124f165 (patch)
treea011c58836777edcbf0334f314676e4eccd1a4bf /gcc/fortran/resolve.c
parent9833720d3bf1e5adf2319bb480b882dad8060182 (diff)
downloadgcc-fc9c6e5d64f4dbdc1f7a53a4fa14ddc3f124f165.zip
gcc-fc9c6e5d64f4dbdc1f7a53a4fa14ddc3f124f165.tar.gz
gcc-fc9c6e5d64f4dbdc1f7a53a4fa14ddc3f124f165.tar.bz2
re PR fortran/39997 (Procedure(), pointer & implicit typing: rejects-valid / accepts-invalid?)
2009-06-26 Janus Weil <janus@gcc.gnu.org> PR fortran/39997 PR fortran/40541 * decl.c (add_hidden_procptr_result): Copy the typespec to the hidden result. * expr.c (gfc_check_pointer_assign): Enable interface check for procedure pointer assignments where the rhs is a function returning a procedure pointer. * resolve.c (resolve_symbol): If an external procedure with unspecified return type can not be implicitly typed, it must be a subroutine. 2009-06-26 Janus Weil <janus@gcc.gnu.org> PR fortran/39997 PR fortran/40541 * gfortran.dg/proc_ptr_15.f90: Fixed and extended. * gfortran.dg/proc_ptr_common_1.f90: Fixed invalid test case. * gfortran.dg/proc_ptr_result_1.f90: Ditto. * gfortran.dg/proc_ptr_result_5.f90: New. From-SVN: r148996
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 9bb6e22..9ea2a2d 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -9551,6 +9551,11 @@ resolve_symbol (gfc_symbol *sym)
if (sym->attr.flavor == FL_VARIABLE || sym->attr.flavor == FL_PARAMETER)
gfc_set_default_type (sym, 1, NULL);
+ if (sym->attr.flavor == FL_PROCEDURE && sym->attr.external
+ && !sym->attr.function && !sym->attr.subroutine
+ && gfc_get_default_type (sym->name, sym->ns)->type == BT_UNKNOWN)
+ gfc_add_subroutine (&sym->attr, sym->name, &sym->declared_at);
+
if (sym->attr.flavor == FL_PROCEDURE && sym->attr.function)
{
/* The specific case of an external procedure should emit an error