[Bug fortran/126485] Regression caused by r16-8455 / `64e03b96dfe`: Fortran: fix resolution of generic interface with TYPE(C_PTR) [PR66973]

albert at tugraz dot at via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126485

Christopher Albert <albert at tugraz dot at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |albert at tugraz dot at,
                   |                            |jvdelisle at gcc dot gnu.org

--- Comment #1 from Christopher Albert <albert at tugraz dot at> ---
Open for review, comments welcome:
https://github.com/lazy-fortran/gcc/pull/44

Root cause: an implicit procedure call can acquire an inferred
interface with artificial dummy arguments, and C_LOC has type BT_VOID
until matched against a declared dummy. The ISO_C_BINDING argument
check that r16-8455 added for PR66973 then rejects a later implicit
call against that inferred interface. The fix is one condition in
gfc_compare_actual_formal: skip the ISO_C_BINDING function checks for
artificial dummies, keeping them for declared interfaces. The PR66973
testcase (generic_36) still passes; check-fortran and the libgomp
Fortran suite are clean.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.