This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50547] dummy procedure argument of PURE shall be PURE
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Sep 2011 11:23:52 +0000
- Subject: [Bug fortran/50547] dummy procedure argument of PURE shall be PURE
- Auto-submitted: auto-generated
- References: <bug-50547-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50547
--- Comment #3 from janus at gcc dot gnu.org 2011-09-29 11:23:52 UTC ---
Here is a better version which is regression-free:
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 179338)
+++ gcc/fortran/resolve.c (working copy)
@@ -269,18 +269,21 @@
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;
Will commit as obvious.