diff options
author | Tobias Burnus <burnus@net-b.de> | 2011-04-28 07:48:18 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2011-04-28 07:48:18 +0200 |
commit | a300121e62712fdafb2b508f8a392cffccf075c8 (patch) | |
tree | 31b49be6d13c3e57672ee9ca8ef933d27ecce92c /gcc/fortran/expr.c | |
parent | 77a30e9a5f8ffbf06702de86d9b58e075d1ddc71 (diff) | |
download | gcc-a300121e62712fdafb2b508f8a392cffccf075c8.zip gcc-a300121e62712fdafb2b508f8a392cffccf075c8.tar.gz gcc-a300121e62712fdafb2b508f8a392cffccf075c8.tar.bz2 |
re PR fortran/48112 (generic interface to external function in module)
2011-04-28 Tobias Burnus <burnus@net-b.de>
PR fortran/48112
* resolve.c (resolve_fl_var_and_proc): Print diagnostic of
function results only once.
(resolve_symbol): Always resolve function results.
PR fortran/48279
* expr.c (gfc_check_vardef_context): Fix handling of generic
EXPR_FUNCTION.
* interface.c (check_interface0): Reject internal functions
in generic interfaces, unless -std=gnu.
2011-04-28 Tobias Burnus <burnus@net-b.de>
PR fortran/48112
PR fortran/48279
* gfortran.dg/interface_35.f90: New.
* gfortran.dg/erfc_scaled_1.f90: Don't compile with -pedantic.
* gfortran.dg/func_result_6.f90: Add dg-warning.
* gfortran.dg/bessel_1.f90: Ditto.
* gfortran.dg/hypot_1.f90: Ditto.
* gfortran.dg/proc_ptr_comp_20.f90: Ditto.
* gfortran.dg/proc_ptr_comp_21.f90: Ditto.
* gfortran.dg/interface_assignment_4.f90: Ditto.
From-SVN: r173059
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index dae2149..3d519db 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -4371,15 +4371,26 @@ gfc_build_intrinsic_call (const char* name, locus where, unsigned numarg, ...) gfc_try gfc_check_vardef_context (gfc_expr* e, bool pointer, const char* context) { - gfc_symbol* sym; + gfc_symbol* sym = NULL; bool is_pointer; bool check_intentin; bool ptr_component; symbol_attribute attr; gfc_ref* ref; + if (e->expr_type == EXPR_VARIABLE) + { + gcc_assert (e->symtree); + sym = e->symtree->n.sym; + } + else if (e->expr_type == EXPR_FUNCTION) + { + gcc_assert (e->symtree); + sym = e->value.function.esym ? e->value.function.esym : e->symtree->n.sym; + } + if (!pointer && e->expr_type == EXPR_FUNCTION - && e->symtree->n.sym->result->attr.pointer) + && sym->result->attr.pointer) { if (!(gfc_option.allow_std & GFC_STD_F2008)) { @@ -4397,9 +4408,6 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, const char* context) return FAILURE; } - gcc_assert (e->symtree); - sym = e->symtree->n.sym; - if (!pointer && sym->attr.flavor == FL_PARAMETER) { if (context) |