From cda7004bb4836fa9e3c7f892c0fc0de3c81d176f Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Mon, 23 Jan 2006 05:07:52 +0000 Subject: re PR fortran/25901 (overloaded function is rejected) 2005-01-23 Paul Thomas PR fortran/25901 * decl.c (get_proc_name): Replace subroutine and function attributes in "already defined" test by the formal arglist pointer being non-NULL. Fix regression in testing of admissability of attributes. * symbol.c (gfc_add_attribute): If the current_attr has non-zero intent, do not do the check for a dummy being used. * decl.c (attr_decl1): Add current_attr.intent as the third argument in the call to gfc_add_attribute. * gfortran.h: Add the third argument to the prototype for gfc_add_attribute. 2005-01-23 Paul Thomas PR fortran/25901 * gfortran.dg/internal references_2.f90: New test. Fix regression in testing of admissability of attributes. * gfortran.dg/intent_used_1.f90: New test. From-SVN: r110106 --- gcc/fortran/symbol.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/symbol.c') diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index c4d2cf0..9a28df6 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -592,12 +592,14 @@ duplicate_attr (const char *attr, locus * where) gfc_error ("Duplicate %s attribute specified at %L", attr, where); } +/* Called from decl.c (attr_decl1) to check attributes, when declared separately. */ try -gfc_add_attribute (symbol_attribute * attr, locus * where) +gfc_add_attribute (symbol_attribute * attr, locus * where, uint attr_intent) { - if (check_used (attr, NULL, where) || check_done (attr, where)) + if (check_used (attr, NULL, where) + || (attr_intent == 0 && check_done (attr, where))) return FAILURE; return check_conflict (attr, NULL, where); -- cgit v1.1