diff options
author | Tobias Burnus <burnus@gcc.gnu.org> | 2012-01-10 00:23:26 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-01-10 00:23:26 +0100 |
commit | 0ec05c678aa9082367c66b88f20cdc7e48ff9b83 (patch) | |
tree | 585403ce656c744d818bf04718321775f449ef8b /gcc | |
parent | 243b92d11e983eaa85919ed223fe6a3bca8cf890 (diff) | |
download | gcc-0ec05c678aa9082367c66b88f20cdc7e48ff9b83.zip gcc-0ec05c678aa9082367c66b88f20cdc7e48ff9b83.tar.gz gcc-0ec05c678aa9082367c66b88f20cdc7e48ff9b83.tar.bz2 |
re PR fortran/46328 ([OOP] type-bound operator call with non-trivial polymorphic operand)
2012-01-09 Tobias Burnus <burnus@net-b.de>
PR fortran/46328
* gfortran.dg/typebound_operator_11.f90: New.
From-SVN: r183039
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/typebound_operator_11.f90 | 42 |
2 files changed, 48 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e9976b9..d360a7f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-01-09 Tobias Burnus <burnus@net-b.de> + + PR fortran/46328 + * gfortran.dg/typebound_operator_11.f90: New. + 2012-01-09 Eric Botcazou <ebotcazou@adacore.com> * gnat.dg/array18.adb: New test. @@ -12,7 +17,7 @@ 2012-01-09 Martin Jambor <mjambor@suse.cz> - PR tree-optimization/51759 + PR tree-optimization/51759 * g++.dg/ipa/pr51759.C: New test. 2012-01-09 Tobias Burnus <burnus@net-b.de> diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_11.f90 b/gcc/testsuite/gfortran.dg/typebound_operator_11.f90 new file mode 100644 index 0000000..1f5c195 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_operator_11.f90 @@ -0,0 +1,42 @@ +! { dg-do compile } +! +! PR fortran/46328 +! +! Contributed by Damian Rouson +! +module foo_module + type ,abstract :: foo + contains + procedure(t_interface) ,deferred :: t + procedure(assign_interface) ,deferred :: assign + procedure(multiply_interface) ,deferred :: multiply + generic :: operator(*) => multiply + generic :: assignment(=) => assign + end type + abstract interface + function t_interface(this) + import :: foo + class(foo) :: this + class(foo), allocatable ::t_interface + end function + function multiply_interface(lhs,rhs) + import :: foo + class(foo), allocatable :: multiply_interface + class(foo), intent(in) :: lhs + real, intent(in) :: rhs + end function + subroutine assign_interface(lhs,rhs) + import :: foo + class(foo), intent(in) :: rhs + class(foo), intent(inout) :: lhs + end subroutine + end interface +contains + subroutine bar(x,dt) + class(foo) :: x + real, intent(in) :: dt + x = x%t()*dt + end subroutine +end module + +! { dg-final { cleanup-modules "foo_module" } } |