+2011-09-29 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50547
+ * resolve.c (resolve_formal_arglist): Fix pureness check for dummy
+ functions.
+
+ PR fortran/50553
+ * symbol.c (check_conflict): Forbid TARGET attribute for statement
+ functions.
+
2011-09-27 Jakub Jelinek <jakub@redhat.com>
* trans-types.c (gfc_type_for_size): Return wider type
if (sym->attr.if_source != IFSRC_UNKNOWN)
resolve_formal_arglist (sym);
+ /* F08:C1279. */
+ if (gfc_pure (proc)
+ && sym->attr.flavor == FL_PROCEDURE && !gfc_pure (sym))
+ {
+ gfc_error ("Dummy procedure '%s' of PURE procedure at %L must "
+ "also be PURE", sym->name, &sym->declared_at);
+ continue;
+ }
+
if (sym->attr.subroutine || sym->attr.external || sym->attr.intrinsic)
{
- if (gfc_pure (proc) && !gfc_pure (sym))
- {
- gfc_error ("Dummy procedure '%s' of PURE procedure at %L must "
- "also be PURE", sym->name, &sym->declared_at);
- continue;
- }
-
if (proc->attr.implicit_pure && !gfc_pure(sym))
proc->attr.implicit_pure = 0;
+ /* F08:C1289. */
if (gfc_elemental (proc))
{
gfc_error ("Dummy procedure at %L not allowed in ELEMENTAL "
if (gfc_elemental (proc))
{
- /* F2008, C1289. */
+ /* F08:C1289. */
if (sym->attr.codimension)
{
gfc_error ("Coarray dummy argument '%s' at %L to elemental "
+2011-09-29 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50547
+ * gfortran.dg/pure_formal_proc_3.f90: New.
+
+ PR fortran/50553
+ * gfortran.dg/stfunc_7.f90: New.
+
2011-09-29 Artjoms Sinkarovs <artyom.shinkaroff@gmail.com>
* gcc.c-torture/execute/vector-compare-1.c: New testcase.
--- /dev/null
+! { dg-do compile }
+!
+! PR 50547: dummy procedure argument of PURE shall be PURE
+!
+! Contributed by Vittorio Zecca <zeccav@gmail.com>
+
+pure function f(proc)
+ interface
+ function proc() ! { dg-error "must also be PURE" }
+ end
+ end interface
+end
--- /dev/null
+! { dg-do compile }
+! { dg-options "-std=legacy" }
+!
+! PR 50553: statement function cannot be target (r178939)
+!
+! Contributed by Vittorio Zecca <zeccav@gmail.com>
+
+f(x)=x
+target f ! { dg-error "attribute conflicts with" }
+end