diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/abstract_type_8.f03')
-rw-r--r-- | gcc/testsuite/gfortran.dg/abstract_type_8.f03 | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/abstract_type_8.f03 b/gcc/testsuite/gfortran.dg/abstract_type_8.f03 new file mode 100644 index 00000000000..c924abac9af --- /dev/null +++ b/gcc/testsuite/gfortran.dg/abstract_type_8.f03 @@ -0,0 +1,29 @@ +! { dg-do compile } +! +! PR 44616: [OOP] ICE if CLASS(foo) is used before its definition +! +! Contributed by bd satish <bdsatish@gmail.com> + +module factory_pattern +implicit none + +type First_Factory + character(len=20) :: factory_type + class(Connection), pointer :: connection_type + contains +end type First_Factory + +type, abstract :: Connection + contains + procedure(generic_desc), deferred :: description +end type Connection + +abstract interface + subroutine generic_desc(self) + import ! Required, cf. PR 44614 + class(Connection) :: self + end subroutine generic_desc +end interface +end module factory_pattern + +! { dg-final { cleanup-modules "factory_pattern" } } |