aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2025-02-13 20:19:56 -0800
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2025-02-15 09:52:20 -0800
commit12771b1d77aef71f9eceead9b46323292f3dd7e4 (patch)
tree58ebb45b639e18fd967e18d0a98aa590e7191b50 /gcc/fortran
parentd7a835a5309db81a129b0151c7e5deb25b0ec55c (diff)
downloadgcc-12771b1d77aef71f9eceead9b46323292f3dd7e4.zip
gcc-12771b1d77aef71f9eceead9b46323292f3dd7e4.tar.gz
gcc-12771b1d77aef71f9eceead9b46323292f3dd7e4.tar.bz2
Fortran: gfortran allows type(C_ptr) in I/O list
Before this patch, gfortran was accepting invalid use of type(c_ptr) in I/O statements. The fix affects several existing test cases so no new test case needed. Existing tests were modified to pass by either using the transfer function to convert to an acceptable value or using an assignment to a like type (non-I/O). PR fortran/117430 gcc/fortran/ChangeLog: * resolve.cc (resolve_transfer): Change gfc_notify_std to gfc_error. gcc/testsuite/ChangeLog: * gfortran.dg/c_loc_test_17.f90: Use an assignment rather than PRINT. * gfortran.dg/c_ptr_tests_10.f03: Use a transfer function. * gfortran.dg/c_ptr_tests_16.f90: Use an assignment. * gfortran.dg/c_ptr_tests_9.f03: Use a transfer function. * gfortran.dg/init_flag_17.f90: Likewise. * gfortran.dg/pr32601_1.f03: Use an assignment.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/resolve.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 1a4799d..3d3f117 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -11824,8 +11824,8 @@ resolve_transfer (gfc_code *code)
the component to be printed to help debugging. */
if (ts->u.derived->ts.f90_type == BT_VOID)
{
- if (!gfc_notify_std (GFC_STD_GNU, "Data transfer element at %L "
- "cannot have PRIVATE components", &code->loc))
+ gfc_error ("Data transfer element at %L "
+ "cannot have PRIVATE components", &code->loc);
return;
}
else if (derived_inaccessible (ts->u.derived) && dtio_sub == NULL)