https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120049
--- Comment #24 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- It is interestingly complex. As I try different test cases I learn new things. For example this error is caught already somewhere else in the code path. I am going to identify where tomorrow. This may be a better place to do some of this checking. test.f90:30:24: 30 | print *, c_associated(42) | 1 Error: Argument C_PTR_1 at (1) to C_ASSOCIATED shall have the type TYPE(C_PTR) or TYPE(C_FUNPTR) I found this only because my draft patch caught this and I found a test failure in the testsuite, My error message was different. In c_assoc_2.f03: if(.not. c_associated(my_integer)) then ! { dg-error "shall have the type TYPE.C_PTR. or TYPE.C_FUNPTR." } STOP 6 end if