aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2016-08-24 19:33:14 +0000
committerPaul Thomas <pault@gcc.gnu.org>2016-08-24 19:33:14 +0000
commit88b8971f9cf7c07de72c8b3fe6d4e691bcef7898 (patch)
tree154f472512471b0925cc1dc3f83fe8d137847510 /gcc/fortran
parentc8cd4696473a9c803b9454adeee57c90565c2fad (diff)
downloadgcc-88b8971f9cf7c07de72c8b3fe6d4e691bcef7898.zip
gcc-88b8971f9cf7c07de72c8b3fe6d4e691bcef7898.tar.gz
gcc-88b8971f9cf7c07de72c8b3fe6d4e691bcef7898.tar.bz2
re PR fortran/77358 ([F08] deferred-length character function returns zero-length string)
2016-08-24 Paul Thomas <pault@gcc.gnu.org> PR fortran/77358 * resolve.c (resolve_fl_procedure): Use the correct gfc_charlen for deferred character length module procedures. 2016-08-24 Paul Thomas <pault@gcc.gnu.org> PR fortran/77358 * gfortran.dg/submodule_17.f08: New test. From-SVN: r239740
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/resolve.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 6dc44e6..93eb48a 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2016-08-24 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/77358
+ * resolve.c (resolve_fl_procedure): Use the correct gfc_charlen
+ for deferred character length module procedures.
+
2016-08-23 Fritz Reese <fritzoreese@gmail.com>
* decl.c (gfc_match_structure_decl): Make gfc_structure_id static.
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index b7036a8..0a92efe 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -11884,6 +11884,13 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
iface = sym->ts.interface;
sym->ts.interface = NULL;
+ /* Make sure that the result uses the correct charlen for deferred
+ length results. */
+ if (iface && sym->result
+ && iface->ts.type == BT_CHARACTER
+ && iface->ts.deferred)
+ sym->result->ts.u.cl = iface->ts.u.cl;
+
if (iface == NULL)
goto check_formal;