gcc/testsuite/gfortran.dg/c_ptr_tests_13.f03
raw| 1 | ! { dg-do compile } |
| 2 | ! Ensure that the user cannot call the structure constructor for one of |
| 3 | ! the iso_c_binding derived types. |
| 4 | ! |
| 5 | ! PR fortran/33760 |
| 6 | ! |
| 7 | program main |
| 8 | use ISO_C_BINDING |
| 9 | implicit none |
| 10 | integer(C_INTPTR_T) p |
| 11 | type(C_PTR) cptr |
| 12 | p = 0 |
| 13 | cptr = C_PTR(p+1) ! { dg-error "is a PRIVATE component of 'c_ptr'" } |
| 14 | cptr = C_PTR(1) ! { dg-error "is a PRIVATE component of 'c_ptr'" } |
| 15 | end program main |