aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/symbol.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2006-01-23 05:07:52 +0000
committerPaul Thomas <pault@gcc.gnu.org>2006-01-23 05:07:52 +0000
commitcda7004bb4836fa9e3c7f892c0fc0de3c81d176f (patch)
tree8ebb2f15eb3f79dbe90e03b880a60ebda46f94d8 /gcc/fortran/symbol.c
parent0743efe14908ff3e39f14de636d1526e4813b4ca (diff)
downloadgcc-cda7004bb4836fa9e3c7f892c0fc0de3c81d176f.zip
gcc-cda7004bb4836fa9e3c7f892c0fc0de3c81d176f.tar.gz
gcc-cda7004bb4836fa9e3c7f892c0fc0de3c81d176f.tar.bz2
re PR fortran/25901 (overloaded function is rejected)
2005-01-23 Paul Thomas <pault@gcc.gnu.org> 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 <pault@gcc.gnu.org> 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
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r--gcc/fortran/symbol.c6
1 files changed, 4 insertions, 2 deletions
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);