aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/symbol.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2017-10-04 10:43:45 +0000
committerPaul Thomas <pault@gcc.gnu.org>2017-10-04 10:43:45 +0000
commit707905d0773e5a8eebb9ba65164f43dc08c658b1 (patch)
tree766b6c1e28ec2bb871c6783225573d614c75b16a /gcc/fortran/symbol.c
parent3e3d1b2326f7c78279275c91b21de38c388ff8fe (diff)
downloadgcc-707905d0773e5a8eebb9ba65164f43dc08c658b1.zip
gcc-707905d0773e5a8eebb9ba65164f43dc08c658b1.tar.gz
gcc-707905d0773e5a8eebb9ba65164f43dc08c658b1.tar.bz2
re PR fortran/60458 (Error message on associate: deferred type parameter and requires either the pointer or allocatable attribute)
2017-10-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/60458 PR fortran/77296 * resolve.c (resolve_assoc_var): Deferred character type associate names must not receive an integer conatant length. * symbol.c (gfc_is_associate_pointer): Deferred character length functions also require an associate pointer. * trans-decl.c (gfc_get_symbol_decl): Deferred character length functions or derived type components require the assoc name to have variable string length. * trans-stmt.c (trans_associate_var): Set the string length of deferred string length associate names. The address expression is not needed for allocatable, pointer or dummy targets. Change the comment about defered string length targets. 2017-10-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/77296 * gfortran.dg/associate_32.f03 : New test. From-SVN: r253400
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r--gcc/fortran/symbol.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 68a76c4..4c109fd 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -5054,6 +5054,12 @@ gfc_is_associate_pointer (gfc_symbol* sym)
if (sym->ts.type == BT_CLASS)
return true;
+ if (sym->ts.type == BT_CHARACTER
+ && sym->ts.deferred
+ && sym->assoc->target
+ && sym->assoc->target->expr_type == EXPR_FUNCTION)
+ return true;
+
if (!sym->assoc->variable)
return false;