From c19a00337aa1cd579cb51ce5aa71a81261b97fe3 Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Sat, 27 Dec 2014 23:40:21 +0100 Subject: re PR fortran/54756 ([OOP] [F08] Should reject CLASS, intent(out) in PURE procedures) 2014-12-27 Janus Weil PR fortran/54756 * resolve.c (resolve_formal_arglist): Reject polymorphic INTENT(OUT) arguments of pure procedures. 2014-12-27 Janus Weil PR fortran/54756 * gfortran.dg/class_array_3.f03: Fixed invalid test case. * gfortran.dg/class_array_7.f03: Ditto. * gfortran.dg/class_dummy_4.f03: Ditto. * gfortran.dg/defined_assignment_3.f90: Ditto. * gfortran.dg/defined_assignment_5.f90: Ditto. * gfortran.dg/elemental_subroutine_10.f90: Ditto. * gfortran.dg/typebound_operator_4.f03: Ditto. * gfortran.dg/typebound_proc_16.f03: Ditto. * gfortran.dg/unlimited_polymorphic_19.f90: Ditto. * gfortran.dg/class_dummy_5.f90: New test. From-SVN: r219085 --- gcc/fortran/resolve.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/fortran/resolve.c') diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 3b8b869..05a948b 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -414,6 +414,15 @@ resolve_formal_arglist (gfc_symbol *proc) &sym->declared_at); } } + + /* F08:C1278a. */ + if (sym->ts.type == BT_CLASS && sym->attr.intent == INTENT_OUT) + { + gfc_error ("INTENT(OUT) argument '%s' of pure procedure %qs at %L" + " may not be polymorphic", sym->name, proc->name, + &sym->declared_at); + continue; + } } if (proc->attr.implicit_pure) -- cgit v1.1