diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/c_ptr_tests_13.f03')
-rw-r--r-- | gcc/testsuite/gfortran.dg/c_ptr_tests_13.f03 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/c_ptr_tests_13.f03 b/gcc/testsuite/gfortran.dg/c_ptr_tests_13.f03 new file mode 100644 index 000000000..c7a603bcc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/c_ptr_tests_13.f03 @@ -0,0 +1,15 @@ +! { dg-do compile } +! Ensure that the user cannot call the structure constructor for one of +! the iso_c_binding derived types. +! +! PR fortran/33760 +! +program main + use ISO_C_BINDING + implicit none + integer(C_INTPTR_T) p + type(C_PTR) cptr + p = 0 + cptr = C_PTR(p+1) ! { dg-error "Components of structure constructor" } + cptr = C_PTR(1) ! { dg-error "Components of structure constructor" } +end program main |