diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/associate_12.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/associate_12.f90 | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/associate_12.f90 b/gcc/testsuite/gfortran.dg/associate_12.f90 new file mode 100644 index 0000000000..1ead1e7112 --- /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" } } |