public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-7703] Fortran: Allow pure final procs contained in pure proc. [PR109684]
@ 2023-08-09 14:54 Paul Thomas
  0 siblings, 0 replies; only message in thread
From: Paul Thomas @ 2023-08-09 14:54 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ed049e5d5f36cc0f4318cd93bb6b33ed6f6f2ba7

commit r13-7703-ged049e5d5f36cc0f4318cd93bb6b33ed6f6f2ba7
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Wed Aug 9 15:53:40 2023 +0100

    Fortran: Allow pure final procs contained in pure proc. [PR109684]
    
    2023-08-09  Steve Kargl  <sgk@troutmask.apl.washington.edu>
    
    gcc/fortran
            PR fortran/109684
            * resolve.cc (resolve_types): Exclude contained procedures with
            the artificial attribute from test for pureness.

Diff:
---
 gcc/fortran/resolve.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 417b20637e3e..72582681bb7b 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -17917,7 +17917,10 @@ resolve_types (gfc_namespace *ns)
 
   for (n = ns->contained; n; n = n->sibling)
     {
-      if (gfc_pure (ns->proc_name) && !gfc_pure (n->proc_name))
+      /* Exclude final wrappers with the test for the artificial attribute.  */
+      if (gfc_pure (ns->proc_name)
+	  && !gfc_pure (n->proc_name)
+	  && !n->proc_name->attr.artificial)
 	gfc_error ("Contained procedure %qs at %L of a PURE procedure must "
 		   "also be PURE", n->proc_name->name,
 		   &n->proc_name->declared_at);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-09 14:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-09 14:54 [gcc r13-7703] Fortran: Allow pure final procs contained in pure proc. [PR109684] Paul Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).