aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2012-01-09 20:25:55 +0000
committerPaul Thomas <pault@gcc.gnu.org>2012-01-09 20:25:55 +0000
commitefd2e969f2571ba3e1bf9a04b88da7ee2144e1d9 (patch)
tree2d3d71ea917fc7d37ec5ce84aab423428e961b02 /gcc/fortran/interface.c
parent3881a3dee847b26d88355db35090214a0b5a7d43 (diff)
downloadgcc-efd2e969f2571ba3e1bf9a04b88da7ee2144e1d9.zip
gcc-efd2e969f2571ba3e1bf9a04b88da7ee2144e1d9.tar.gz
gcc-efd2e969f2571ba3e1bf9a04b88da7ee2144e1d9.tar.bz2
re PR fortran/51791 ([OOP] Failure to resolve typebound function call with base object in parentheses.)
2012-01-09 Paul Thomas <pault@gcc.gnu.org> PR fortran/51791 * interface.c (matching_typebound_op): Drill down through possible parentheses to obtain base expression. Do not test for 'class_ok' but, instead for the class structure components. * resolve.c (resolve_ordinary_assign): Extend error message for polymorphic assignment to advise checking for specific subroutine. PR fortran/51792 * resolve.c (resolve_typebound_function): Restore 'static' to declaration. 2012-01-09 Paul Thomas <pault@gcc.gnu.org> PR fortran/51791 * gfortran.dg/typebound_operator_7.f03: Insert parentheses around base object in first assignment in main program. * gfortran.dg/typebound_operator_10.f03: New test. From-SVN: r183032
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 773749d..94f767d 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -3168,9 +3168,13 @@ matching_typebound_op (gfc_expr** tb_base,
gfc_symbol* derived;
gfc_try result;
+ while (base->expr->expr_type == EXPR_OP
+ && base->expr->value.op.op == INTRINSIC_PARENTHESES)
+ base->expr = base->expr->value.op.op1;
+
if (base->expr->ts.type == BT_CLASS)
{
- if (!gfc_expr_attr (base->expr).class_ok)
+ if (CLASS_DATA (base->expr) == NULL)
continue;
derived = CLASS_DATA (base->expr)->ts.u.derived;
}