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

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

commit r14-3098-gb8ec3c952324f866f191883473922e250be81341
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Wed Aug 9 12:04:09 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 3cd470ddccaf..e7c8d919bef0 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -17966,7 +17966,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 11:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-09 11:04 [gcc r14-3098] 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).