summaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-28 05:48:18 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-28 05:48:18 +0000
commit5ff3464c4fa5ce7d7065f5dea83c4bc4ebedef8c (patch)
tree31b49be6d13c3e57672ee9ca8ef933d27ecce92c /gcc/fortran/expr.c
parent581edfc43108ca4cb206c7b2bcf41d0fc4118c7d (diff)
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173059 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index dae2149b1dec..3d519db4df25 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)