aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/primary.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/associate_12.f9029
4 files changed, 42 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8e3e728..084f1f8 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-04 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/55199
+ * primary.c (gfc_match_varspec): Clear typespec if it cannot be
+ determined at this point.
+
2012-10-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/53718
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 7b64a3c..6be55b0 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1975,6 +1975,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
gcc_assert (primary->symtree->n.sym->attr.referenced);
if (tbp_sym)
primary->ts = tbp_sym->ts;
+ else
+ gfc_clear_ts (&primary->ts);
m = gfc_match_actual_arglist (tbp->n.tb->subroutine,
&primary->value.compcall.actual);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0473976..4aced9c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-04 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/55199
+ * gfortran.dg/associate_12.f90: New.
+
2012-11-03 Jack Howarth <howarth@bromo.med.uc.edu>
PR target/54255
diff --git a/gcc/testsuite/gfortran.dg/associate_12.f90 b/gcc/testsuite/gfortran.dg/associate_12.f90
new file mode 100644
index 0000000..1ead1e7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/associate_12.f90
@@ -0,0 +1,29 @@
+! { dg-do compile }
+!
+! PR 55199: [OOP] Equivalenced variable has wrong type when used with generic member function
+!
+! Contributed by Rich Townsend <townsend@astro.wisc.edu>
+
+module assoc_err_m
+ implicit none
+ type :: foo_t
+ contains
+ procedure :: func_1
+ generic :: func => func_1
+ end type
+contains
+ real function func_1 (this)
+ class(foo_t), intent(in) :: this
+ end function
+end module
+
+program assoc_err
+ use assoc_err_m
+ implicit none
+ type(foo_t) :: f
+ associate(b => f%func())
+ print *, 1. + b
+ end associate
+end program
+
+! { dg-final { cleanup-modules "assoc_err_m" } }