https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119419

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Thomas Koenig <tkoe...@gcc.gnu.org>:

https://gcc.gnu.org/g:737a5760bb24a0a945cc2c916ba452e3f0060c58

commit r15-8906-g737a5760bb24a0a945cc2c916ba452e3f0060c58
Author: Thomas Koenig <tkoe...@gcc.gnu.org>
Date:   Tue Mar 25 18:42:30 2025 +0100

    C prototypes for functions returning C function pointers.

    This patch handles dumping prototypes for C functions returning
    function pointers.  For the test case

    MODULE test
       USE, INTRINSIC :: ISO_C_BINDING
    CONTAINS
       FUNCTION lookup(idx) BIND(C)
         type(C_FUNPTR) :: lookup
         integer(C_INT), VALUE :: idx
         lookup = C_FUNLOC(x1)
       END FUNCTION lookup

       subroutine x1()
       end subroutine x1
     END MODULE test

    the prototype is

    void (*lookup (int idx)) ();

    Regression-tested.  Again no test case because I don't know how.
    During testing, I also found that vtabs were dumped, this is
    also corrected.

    gcc/fortran/ChangeLog:

            PR fortran/119419
            * dump-parse-tree.cc (write_funptr_fcn): New function.
            (write_type): Invoke it for C_FUNPTR.
            (write_interop_decl): Do not dump vtabs.

Reply via email to