2013-07-25 Janus Weil <janus@gcc.gnu.org>
+ PR fortran/57966
+ * resolve.c (resolve_typebound_function): Make sure the declared type,
+ including its type-bound procedures, is resolved before resolving the
+ actual type-bound call.
+
+2013-07-25 Janus Weil <janus@gcc.gnu.org>
+
PR fortran/57639
* interface.c (compare_parameter): Check for class_ok.
* simplify.c (gfc_simplify_same_type_as): Ditto.
}
+static bool resolve_fl_derived (gfc_symbol *sym);
+
/* Resolve a typebound function, or 'method'. First separate all
the non-CLASS references by calling resolve_compcall directly. */
/* Get the CLASS declared type. */
declared = get_declared_from_expr (&class_ref, &new_ref, e, true);
+
+ if (!resolve_fl_derived (declared))
+ return false;
/* Weed out cases of the ultimate component being a derived type. */
if ((class_ref && class_ref->u.c.component->ts.type == BT_DERIVED)
+2013-07-25 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/57966
+ * gfortran.dg/typebound_call_25.f90: New.
+
2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57981
--- /dev/null
+! { dg-do compile }
+!
+! PR 57966: [OOP] Using a TBP to specify the shape of a dummy argument
+!
+! Contributed by Stefan Mauerberger <stefan.mauerberger@gmail.com>
+
+MODULE my_mod
+ IMPLICIT NONE
+
+ TYPE config_cls
+ CONTAINS
+ PROCEDURE, NOPASS :: my_size
+ PROCEDURE, NOPASS :: my_sub
+ GENERIC :: sz => my_size
+ GENERIC :: sub => my_sub
+ END TYPE
+
+ TYPE(config_cls) :: config
+
+CONTAINS
+
+ PURE INTEGER FUNCTION my_size()
+ my_size = 10
+ END FUNCTION
+
+ SUBROUTINE my_sub
+ END SUBROUTINE
+
+ SUBROUTINE test (field1, field2, field3, field4)
+ REAL :: field1 (config%my_size())
+ REAL :: field2 (config%sz())
+ REAL :: field3 (config%my_sub()) ! { dg-error "should be a FUNCTION" }
+ REAL :: field4 (config%sub()) ! { dg-error "should be a FUNCTION" }
+ END SUBROUTINE
+
+END MODULE
+
+! { dg-final { cleanup-modules "my_mod" } }