summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocate_alloc_opt_12.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/allocate_alloc_opt_12.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_alloc_opt_12.f9019
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/allocate_alloc_opt_12.f90 b/gcc/testsuite/gfortran.dg/allocate_alloc_opt_12.f90
new file mode 100644
index 000000000..2af069293
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_alloc_opt_12.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+!
+! PR 45507: [4.6 Regression] Bogus Error: Can't convert TYPE(c_ptr) to INTEGER(4)
+!
+! Contributed by Andrew Benson <abenson@its.caltech.edu>
+
+ use, intrinsic :: iso_c_binding
+
+ type :: cType
+ type(c_ptr) :: accelPtr = c_null_ptr
+ end type cType
+
+ type(cType), allocatable, dimension(:) :: filters
+ class(cType), allocatable :: f
+
+ allocate(filters(1))
+ allocate(f,MOLD=filters(1))
+
+end