diff options
| author | Paul Thomas <pault@gcc.gnu.org> | 2025-12-06 08:05:41 +0000 |
|---|---|---|
| committer | Paul Thomas <pault@gcc.gnu.org> | 2025-12-06 08:05:41 +0000 |
| commit | 78c787bbe593b24d73dbcfe59b8f6103be1e798f (patch) | |
| tree | c841b6c17e2f8c677d7ebe20a933192f14f43d91 /gcc/fortran | |
| parent | 52154ade9695aed91e3f921d7cb4f0998a7e02bb (diff) | |
| download | gcc-78c787bbe593b24d73dbcfe59b8f6103be1e798f.zip gcc-78c787bbe593b24d73dbcfe59b8f6103be1e798f.tar.gz gcc-78c787bbe593b24d73dbcfe59b8f6103be1e798f.tar.bz2 | |
Fortran: [PDT] Failure with local allocatable PDT array [PR122693]
2025-12-06 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/122693
* array.cc (gfc_match_array_constructor): Stash and restore
gfc_current_ns after the call to 'gfc_match_type_spec'.
gcc/testsuite
PR fortran/122693
* gfortran.dg/pdt_75.f03: New test.
Diffstat (limited to 'gcc/fortran')
| -rw-r--r-- | gcc/fortran/array.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/array.cc b/gcc/fortran/array.cc index 359d743..471f0cb 100644 --- a/gcc/fortran/array.cc +++ b/gcc/fortran/array.cc @@ -1344,6 +1344,7 @@ gfc_match_array_constructor (gfc_expr **result) match m; const char *end_delim; bool seen_ts; + gfc_namespace *old_ns = gfc_current_ns; head = NULL; seen_ts = false; @@ -1368,6 +1369,8 @@ gfc_match_array_constructor (gfc_expr **result) /* Try to match an optional "type-spec ::" */ gfc_clear_ts (&ts); m = gfc_match_type_spec (&ts); + gfc_current_ns = old_ns; + if (m == MATCH_YES) { seen_ts = (gfc_match (" ::") == MATCH_YES); |
