This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/50547] dummy procedure argument of PURE shall be PURE


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]