2018-10-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83999
* resolve.c (resolve_fl_procedure): Include class functions in
the test that elemental function results be scalar.
2018-10-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83999
* gfortran.dg/elemental_function_4.f90 : New test.
From-SVN: r264899
- 2018-10-06 Thomas Koenig <tkoenig@gcc.gnu.org>
+2018-10-06 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from trunk
+ * resolve.c (resolve_fl_procedure): Include class functions in
+ the test that elemental function results be scalar.
+
+2018-10-06 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/84640
* simplify.c (gfc_simplify_cshift): Extend size of hs_ex and ss_ex
}
/* An elemental function is required to return a scalar 12.7.1 */
- if (sym->attr.elemental && sym->attr.function && sym->as)
+ if (sym->attr.elemental && sym->attr.function
+ && (sym->as || (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->as)))
{
gfc_error ("ELEMENTAL function %qs at %L must have a scalar "
"result", sym->name, &sym->declared_at);
+2018-10-06 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/83999
+ * gfortran.dg/elemental_function_4.f90 : New test.
+
2018-10-05 Peter Bergner <bergner@linux.ibm.com>
PR rtl-optimization/86939
--- /dev/null
+! { dg-do compile }
+!
+! Tests the fix for PR83999, where the invalid function 'f' caused an ICE.
+!
+! Contributed by Gerhard Steinmetz <gscfq@t-online.de>
+!
+program p
+ type t
+ integer :: a
+ end type
+ type(t) :: x(3)
+ x = f()
+ print *, x
+contains
+ elemental function f() result(z) ! { dg-error "must have a scalar result" }
+ type(t), pointer :: z(:)
+ end
+end