From: Paul Thomas Date: Wed, 9 Aug 2023 11:04:09 +0000 (+0100) Subject: Fortran: Allow pure final procs contained in pure proc. [PR109684] X-Git-Tag: basepoints/gcc-15~7041 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8ec3c952324f866f191883473922e250be81341;p=thirdparty%2Fgcc.git Fortran: Allow pure final procs contained in pure proc. [PR109684] 2023-08-09 Steve Kargl gcc/fortran PR fortran/109684 * resolve.cc (resolve_types): Exclude contained procedures with the artificial attribute from test for pureness. --- 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);