https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49111
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Harald Anlauf <[email protected]>: https://gcc.gnu.org/g:50959e53e40ae087ee7bdbce7229b4b8b3cd1bb6 commit r16-4308-g50959e53e40ae087ee7bdbce7229b4b8b3cd1bb6 Author: Harald Anlauf <[email protected]> Date: Tue Oct 7 21:54:45 2025 +0200 Fortran: fix warnings for symbols with C binding and declared PRIVATE [PR49111] The Fortran standard does not prohibit restricting the accessibility of a symbol by use of the PRIVATE attribute and exposing it via a C binding label. Instead of unconditionally generating a warning, only warn if the binding label is surprisingly identical to the privatized Fortran symbol and when -Wsurprising is specified. PR fortran/49111 gcc/fortran/ChangeLog: * decl.cc (verify_bind_c_sym): Modify condition for generation of accessibility warning, and adjust warning message. gcc/testsuite/ChangeLog: * gfortran.dg/binding_label_tests_9.f03: Adjust test. * gfortran.dg/module_private_2.f90: Likewise. * gfortran.dg/public_private_module_2.f90: Likewise. * gfortran.dg/binding_label_tests_35.f90: New test.
