summaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-29 18:41:00 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-29 18:41:00 +0000
commit0c482c1d1b25119534145b9b15aabd96d7575688 (patch)
tree5226f832c787830f57624fc0a90fe130920aef55 /gcc/fortran/decl.c
parentb7eff1deea81677dd4f7364cccd8fcd984e5fd92 (diff)
downloadgcc-0c482c1d1b25119534145b9b15aabd96d7575688.tar.gz
2011-05-29 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45786 * interface.c (gfc_equivalent_op): New function. (gfc_check_interface): Use gfc_equivalent_op instead of switch statement. * decl.c (access_attr_decl): Also set access to an equivalent operator. 2011-05-29 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/45786 * gfortran.dg/operator_7.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174412 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 8acd594f083..e97168fbad2 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -6478,8 +6478,19 @@ access_attr_decl (gfc_statement st)
case INTERFACE_INTRINSIC_OP:
if (gfc_current_ns->operator_access[op] == ACCESS_UNKNOWN)
{
+ gfc_intrinsic_op other_op;
+
gfc_current_ns->operator_access[op] =
(st == ST_PUBLIC) ? ACCESS_PUBLIC : ACCESS_PRIVATE;
+
+ /* Handle the case if there is another op with the same
+ function, for INTRINSIC_EQ vs. INTRINSIC_EQ_OS and so on. */
+ other_op = gfc_equivalent_op (op);
+
+ if (other_op != INTRINSIC_NONE)
+ gfc_current_ns->operator_access[other_op] =
+ (st == ST_PUBLIC) ? ACCESS_PUBLIC : ACCESS_PRIVATE;
+
}
else
{