diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2018-08-12 10:55:13 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2018-08-12 10:55:13 +0000 |
commit | 8532a010b68c33716346bbd9f253fa51392bf4d1 (patch) | |
tree | d7b6504de6b09a221cf322f1d127851b9abc0691 | |
parent | a49317452416282f4cb4da0149754c58d87b2241 (diff) | |
download | gcc-8532a010b68c33716346bbd9f253fa51392bf4d1.zip gcc-8532a010b68c33716346bbd9f253fa51392bf4d1.tar.gz gcc-8532a010b68c33716346bbd9f253fa51392bf4d1.tar.bz2 |
re PR fortran/86906 (erroneous name clash with renaming in use statement)
2018-08-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/86906
* resolve.c (resolve_fl_variable_derived): Check if the derived
type is use associated before checking for the host association
error.
2018-08-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/86906
* gfortran.dg/use_rename_9.f90: New test.
From-SVN: r263494
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/use_rename_9.f90 | 19 |
4 files changed, 32 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 26ff784..2d9c1f0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2018-08-12 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/86906 + * resolve.c (resolve_fl_variable_derived): Check if the derived + type is use associated before checking for the host association + error. + 2018-08-10 Janus Weil <janus@gcc.gnu.org> PR fortran/57160 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 16146e6..d65118d 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -12131,6 +12131,7 @@ resolve_fl_variable_derived (gfc_symbol *sym, int no_init_flag) namespace. 14.6.1.3 of the standard and the discussion on comp.lang.fortran. */ if (sym->ns != sym->ts.u.derived->ns + && !sym->ts.u.derived->attr.use_assoc && sym->ns->proc_name->attr.if_source != IFSRC_IFBODY) { gfc_symbol *s; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 38c3329..bced6d3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-08-12 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/86906 + * gfortran.dg/use_rename_9.f90: New test. + 2018-08-11 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/86835 diff --git a/gcc/testsuite/gfortran.dg/use_rename_9.f90 b/gcc/testsuite/gfortran.dg/use_rename_9.f90 new file mode 100644 index 0000000..a26df9e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/use_rename_9.f90 @@ -0,0 +1,19 @@ +! { dg-do compile } +! +! Test the fix for PR86906, in which a spurious error was generated +! by 'config' in the subroutine having the same symbol name as the +! renamed 'foo_config'. +! +! Contributed by Damian Rouson <damian@sourceryinstitute.org> +! +module foo + type config + end type +end module + use foo, only: foo_config => config +contains + subroutine cap + integer config + type(foo_config) extra + end subroutine +end |