diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-27 07:09:06 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-27 07:09:06 +0000 |
commit | 20bdca22926783b97d735e4e9eedbf8357d36c9e (patch) | |
tree | fe0ca5f04c7acfc990df2467d358c30147ce59fc /gcc/fortran/resolve.c | |
parent | 826b430e7e18f77371ecf77f084fbd35d4fe2960 (diff) | |
download | gcc-20bdca22926783b97d735e4e9eedbf8357d36c9e.tar.gz |
2013-01-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55789
PR fortran/56047
* gfortran.h : Add associate_var to symbol_attr.
* resolve.c (resolve_assoc_var): Set associate_var attribute.
If the target class_ok is set, set it for the associate
variable.
* check.c (allocatable_check): Associate variables should not
have the allocatable attribute even if their symbols do.
* class.c (gfc_build_class_symbol): Symbols with associate_var
set will always have a good class container.
2013-01-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55789
* gfortran.dg/associate_14.f90: New test.
PR fortran/56047
* gfortran.dg/associate_13.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195492 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index ddb6d67aaf2..f2e6b9dd625 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -8325,6 +8325,13 @@ resolve_assoc_var (gfc_symbol* sym, bool resolve_target) has no corank. */ sym->as->corank = 0; } + + /* Mark this as an associate variable. */ + sym->attr.associate_var = 1; + + /* If the target is a good class object, so is the associate variable. */ + if (sym->ts.type == BT_CLASS && gfc_expr_attr (target).class_ok) + sym->attr.class_ok = 1; } |