+2018-08-04 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/45521
+ * interface.c (gfc_compare_interfaces): Apply additional
+ distinguishability criteria of F08 to operator interfaces.
+
2018-07-31 Andre Vieira <andre.simoesdiasvieira@arm.com>
Revert 'AsyncI/O patch committed'
}
else
{
- /* Only check type and rank. */
+ /* Operators: Only check type and rank of arguments. */
if (!compare_type (f2->sym, f1->sym))
{
if (errmsg != NULL)
symbol_rank (f2->sym));
return false;
}
+ if ((gfc_option.allow_std & GFC_STD_F2008)
+ && (compare_ptr_alloc(f1->sym, f2->sym)
+ || compare_ptr_alloc(f2->sym, f1->sym)))
+ {
+ if (errmsg != NULL)
+ snprintf (errmsg, err_len, "Mismatching POINTER/ALLOCATABLE "
+ "attribute in argument '%s' ", f1->sym->name);
+ return false;
+ }
}
}
+
+2018-08-04 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/45521
+ * gfortran.dg/interface_assignment_6.f90: New test case.
+
2018-08-04 Uros Bizjak <ubizjak@gmail.com>
PR testsuite/86153
--- /dev/null
+! { dg-do compile }
+!
+! PR 45521: [F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+module inteface_assignment_6
+
+ type :: t
+ end type
+
+ ! this was rejected as ambiguous, but is valid in F08
+ interface assignment(=)
+ procedure testAlloc
+ procedure testPtr
+ end interface
+
+contains
+
+ subroutine testAlloc(obj, val)
+ type(t), allocatable, intent(out) :: obj
+ integer, intent(in) :: val
+ end subroutine
+
+ subroutine testPtr(obj, val)
+ type(t), pointer, intent(out) :: obj
+ integer, intent(in) :: val
+ end subroutine
+
+end