PR fortran/45933
* resolve.c (resolve_typebound_function): Use correct declared type
for type-bound operators.
2010-10-07 Janus Weil <janus@gcc.gnu.org>
PR fortran/45933
* gfortran.dg/typebound_operator_5.f03: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165126
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-10-07 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/45933
+ * resolve.c (resolve_typebound_function): Use correct declared type
+ for type-bound operators.
+
2010-10-07 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/45916
/* Deal with typebound operators for CLASS objects. */
expr = e->value.compcall.base_object;
- if (expr && expr->symtree->n.sym->ts.type == BT_CLASS
- && e->value.compcall.name)
+ if (expr && expr->ts.type == BT_CLASS && e->value.compcall.name)
{
/* Since the typebound operators are generic, we have to ensure
that any delays in resolution are corrected and that the vtab
is present. */
- ts = expr->symtree->n.sym->ts;
+ ts = expr->ts;
declared = ts.u.derived;
c = gfc_find_component (declared, "$vptr", true, true);
if (c->ts.u.derived == NULL)
+2010-10-07 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/45933
+ * gfortran.dg/typebound_operator_5.f03: New.
+
2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
Merge from 'apple/trunk' branch on FSF servers.
--- /dev/null
+! { dg-do compile }
+!
+! PR 45933: [4.6 regression] [OOP] ICE in gfc_add_component_ref, at fortran/class.c:77
+!
+! Contributed by Mark Rashid <mmrashid@ucdavis.edu>
+
+MODULE DEF1
+ TYPE :: DAT
+ INTEGER :: NN
+ CONTAINS
+ PROCEDURE :: LESS_THAN
+ GENERIC :: OPERATOR (.LT.) => LESS_THAN
+ END TYPE
+CONTAINS
+ LOGICAL FUNCTION LESS_THAN(A, B)
+ CLASS (DAT), INTENT (IN) :: A, B
+ LESS_THAN = (A%NN .LT. B%NN)
+ END FUNCTION
+END MODULE
+
+PROGRAM P
+ USE DEF1
+ TYPE NODE
+ TYPE (DAT), POINTER :: PT
+ END TYPE
+ CLASS (NODE),POINTER :: A, B
+ PRINT *, A%PT .LT. B%PT
+END
+
+! { dg-final { cleanup-modules "DEF1" } }