diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2011-05-29 18:41:00 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2011-05-29 18:41:00 +0000 |
commit | fb03a37e57f31ad176cd901fcc39243d524d4cd4 (patch) | |
tree | 5226f832c787830f57624fc0a90fe130920aef55 /gcc/fortran/decl.c | |
parent | 427180d243e562912cc37f09b140a4d8c042ae4c (diff) | |
download | gcc-fb03a37e57f31ad176cd901fcc39243d524d4cd4.zip gcc-fb03a37e57f31ad176cd901fcc39243d524d4cd4.tar.gz gcc-fb03a37e57f31ad176cd901fcc39243d524d4cd4.tar.bz2 |
re PR fortran/45786 (Relational operators .eq. and == are not recognized as equivalent)
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.
From-SVN: r174412
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 8acd594..e97168f 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 { |