summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/alloc_comp_class_2.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/alloc_comp_class_2.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/alloc_comp_class_2.f9029
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_class_2.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_class_2.f90
new file mode 100644
index 000000000..718628189
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/alloc_comp_class_2.f90
@@ -0,0 +1,29 @@
+! { dg-do run }
+!
+! PR 46838: [OOP] Initialization of polymorphic allocatable components
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+program bug28
+
+ implicit none
+
+ type indx_map
+ end type
+
+ type desc_type
+ integer, allocatable :: matrix_data
+ class(indx_map), allocatable :: indxmap
+ end type
+
+ type(desc_type) :: desc_a
+ call cdall(desc_a)
+
+contains
+
+ subroutine cdall(desc)
+ type(desc_type), intent(out) :: desc
+ if (allocated(desc%indxmap)) call abort()
+ end subroutine cdall
+
+end program