aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2023-08-09 12:04:09 +0100
committerPaul Thomas <pault@gcc.gnu.org>2023-08-09 12:04:09 +0100
commitb8ec3c952324f866f191883473922e250be81341 (patch)
tree2ef9076273da0b11b7e1c64b3b18de7984dade63
parente3476ed2233911e6a578488899179bd91e818947 (diff)
downloadgcc-b8ec3c952324f866f191883473922e250be81341.zip
gcc-b8ec3c952324f866f191883473922e250be81341.tar.gz
gcc-b8ec3c952324f866f191883473922e250be81341.tar.bz2
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.
-rw-r--r--gcc/fortran/resolve.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 3cd470d..e7c8d91 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);