diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-12-31 07:51:47 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-12-31 07:51:47 +0000 |
commit | be6157d72689878721cfb668f0651bb0ee66644a (patch) | |
tree | 0a1668c69fc38755835c122fed653360618c6097 /gcc/fortran/resolve.c | |
parent | 8d7cdc4d836ea90036693c81a76ed0bd0fd1867b (diff) | |
download | ppe42-gcc-be6157d72689878721cfb668f0651bb0ee66644a.tar.gz ppe42-gcc-be6157d72689878721cfb668f0651bb0ee66644a.zip |
2006-12-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/27900
* resolve.c (resolve_actual_arglist): If all else fails and a
procedure actual argument has no type, see if a specific
intrinsic matches.
PR fortran/24325
* resolve.c (resolve_function): If the function reference is
FL_VARIABLE this is an error.
2006-12-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/27900
* gfortran.dg/intrinsic_actual_4.f90: New test.
PR fortran/24325
* gfortran.dg/func_decl_3.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120296 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 1b46a10ca5f..ba547f20c55 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -140,6 +140,21 @@ resolve_formal_arglist (gfc_symbol * proc) continue; } + if (sym->attr.function + && sym->ts.type == BT_UNKNOWN + && sym->attr.intrinsic) + { + gfc_intrinsic_sym *isym; + isym = gfc_find_function (sym->name); + if (isym == NULL || !isym->specific) + { + gfc_error ("Unable to find a specific INTRINSIC procedure " + "for the reference '%s' at %L", sym->name, + &sym->declared_at); + } + sym->ts = isym->ts; + } + continue; } @@ -937,6 +952,21 @@ resolve_actual_arglist (gfc_actual_arglist * arg, procedure_type ptype) && sym->ns->parent->proc_name == sym))) goto got_variable; + /* If all else fails, see if we have a specific intrinsic. */ + if (sym->attr.function + && sym->ts.type == BT_UNKNOWN + && sym->attr.intrinsic) + { + gfc_intrinsic_sym *isym; + isym = gfc_find_function (sym->name); + if (isym == NULL || !isym->specific) + { + gfc_error ("Unable to find a specific INTRINSIC procedure " + "for the reference '%s' at %L", sym->name, + &e->where); + } + sym->ts = isym->ts; + } goto argument_list; } @@ -1512,6 +1542,13 @@ resolve_function (gfc_expr * expr) if (expr->symtree) sym = expr->symtree->n.sym; + if (sym && sym->attr.flavor == FL_VARIABLE) + { + gfc_error ("'%s' at %L is not a function", + sym->name, &expr->where); + return FAILURE; + } + /* If the procedure is not internal, a statement function or a module procedure,it must be external and should be checked for usage. */ if (sym && !sym->attr.dummy && !sym->attr.contained |