https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117430
--- Comment #3 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- Where we resolve the data transfer statement the variable c_ptr is derived, It has an attribute of private_comp. The interop_kind is 0. The gdb in resolve.cc shows: 11745 derived = ts->u.derived; (gdb) n 11748 if (dt && (dt->format_expr || dt->format_label)) (gdb) p *derived $37 = {name = 0x7fffe9626118 "c_ptr", module = 0x7fffe961e7b0 "__iso_c_binding", declared_at = { nextc = 0x35096b0, u = {lb = 0x3509640, location = 55612992}}, ts = {type = BT_DERIVED, kind = 0, u = {derived = 0x356de10, cl = 0x356de10, pad = 56024592}, interface = 0x0, is_c_interop = 1, is_iso_c = 1, f90_type = BT_VOID, deferred = false, interop_kind = 0x0}, attr = {allocatable = 0, dimension = 0, codimension = 0, external = 0, intrinsic = 0, optional = 0, pointer = 0, target = 0, value = 0, volatile_ = 0, temporary = 0, dummy = 0, result = 0, assign = 0, threadprivate = 0, not_always_present = 0, implied_index = 0, subref_array_pointer = 0, proc_pointer = 0, asynchronous = 0, contiguous = 0, fe_temp = 0, automatic = 0, class_pointer = 0, save = SAVE_NONE, data = 0, is_protected = 0, use_assoc = 1, used_in_submodule = 0, use_only = 0, use_rename = 0, imported = 0, host_assoc = 0, in_namelist = 0, in_common = 0, in_equivalence = 0, function = 0, subroutine = 0, procedure = 0, generic = 0, generic_copy = 0, implicit_type = 0, untyped = 0, is_bind_c = 1, extension = 0, is_class = 0, class_ok = 0, vtab = 0, vtype = 0, is_c_interop = 1, is_iso_c = 0, sequence = 0, elemental = 0, pure = 0, recursive = 0, unmaskable = 0, masked = 0, contained = 0, mod_proc = 0, abstract = 0, module_procedure = 0, public_used = 0, implicit_pure = 0, array_outer_dependency = 0, noreturn = 0, entry = 0, entry_master = 0, mixed_entry_master = 0, always_explicit = 0, artificial = 0, referenced = 1, is_main_program = 0, access = ACCESS_UNKNOWN, intent = INTENT_UNKNOWN, flavor = FL_DERIVED, if_source = IFSRC_UNKNOWN, proc = PROC_UNKNOWN, cray_pointer = 0, cray_pointee = 0, alloc_comp = 0, pointer_comp = 0, proc_pointer_comp = 0, private_comp = 1, zero_comp = 0, coarray_comp = 0, lock_comp = 0, event_comp = 0, defined_assign_comp = 0, I put in a test check and see that we have about half a dozen existing test cases that are caught and obviously invalid per this PR. I am not sure I have enough information here to properly check this. Does the expression for the c_ptr variable need to have an additional attribute set? Perhaps in gfc_resolve_expr?